For local development with the AWS services, I am using localstack. Right now I want to work with SNS and when I publish a message the subscriber doesn't receive the 'metadata' (like MessageId, TopicArn, Timestamp)
I have taken the next steps:
Started the docker container:
docker run --net=host -it -p 4567-4578:4567-4578 -p 8080:8080 atlassianlabs/localstack
Created an SNS topic:
aws --endpoint-url=http://localhost:4575 sns create-topic --name test-topic
Subscribed to the topic:
aws --endpoint-url=http://localhost:4575 sns subscribe --topic-arn arn:aws:sns:eu-west-1:123456789012:test-topic --protocol http --notification-endpoint http://localhost.dev.local/path
And finally, I've published a message:
aws --endpoint-url=http://localhost:4575 sns publish --topic-arn arn:aws:sns:eu-west-1:123456789012:test-topic --message "the message"
The subscriber received with success the message but 'messageId', 'Timestamp' and 'TopicArn' was missing:
Actual result:
{"Message": "the message", "Type": "Notification"}
Expected result:
{"TopicArn": "arn:aws:sns:eu-central-1:123456789012:test-topic", "MessageId": "af3a73ef-b0b2-4f78-acb1-1dee52d002d2", "Message": "the message", "Type": "Notification" "Timestamp" : "2018-07-19T16:04:28.857Z"}
What am I doing wrong? And how do I ensure that the message does get this information?