Hi,
Currently JustSaying posts messages which are in this format
{
Subject = <messageType>,
Message = <messageBody>
}
This works well when using JustSaying to send and receive messages. However, this is also a limitation because there are cases when we are not in control of the incoming message format.
One example is using SES to send emails. This service also allows to listen for delivery notifications, such as bounce notifications. In this case, SES publishes notifications to our topic of choice. When JustSaying polls for new messages, the received message looks completely different:
{
"Type" : "Notification",
"MessageId" : "--id--",
"TopicArn" : "arn:aws:sns:eu-west-1:963735208092:--topicname--",
"Message" : "{\"notificationType\":\"Bounce\",\"bounce\":{\"bounceSubType\":\"General\",\"bounceType\":\"Permanent\",\"reportingMTA\":\"dsn; a6-180.smtp-out.eu-west-1.amazonses.com\",\"bouncedRecipients\":[{\"emailAddress\":\"[email protected]\",\"status\":\"5.1.1\",\"diagnosticCode\":\"smtp; 550 5.1.1 user unknown\",\"action\":\"failed\"}],\"timestamp\":\"2015-06-05T13:48:57.172Z\",\"feedbackId\":\"0000014dc3fb5186-78d7691e-7665-47f9-8f81-182e8da28ba1-000000\"},\"mail\":{\"timestamp\":\"2015-06-05T13:48:55.000Z\",\"source\":\"--sourceemail--\",\"messageId\":\"0000014dc3fb4cac-23402d11-bfe7-4735-b663-5b6eca2f0daf-000000\",\"destination\":[\"[email protected]\",\"--dest-email--\"]}}",
"Timestamp" : "2015-06-05T13:48:57.223Z",
"SignatureVersion" : "1",
"Signature" : "--..",
"SigningCertURL" : "--..--",
"UnsubscribeURL" : "--..--"
}
What we'd like to do is to be able to add custom serializators, which would be able to parse this message. IMessageSerialisationFactory is already acting in that area, but what will need to be changed is how the message type is discovered (currently that is built-in), and where the message body is being loaded from.
We are working on this feature, will give update once we have something in this area.