3
votes

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:

  1. Started the docker container:

    docker run --net=host -it -p 4567-4578:4567-4578 -p 8080:8080 atlassianlabs/localstack
    
  2. Created an SNS topic:

    aws --endpoint-url=http://localhost:4575 sns create-topic --name test-topic
    
  3. 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
    
  4. 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?

1
Did you ever solve this?Adam Thomason
Hi Adam, no I haven't solved it but Ignas noticed that it was fixed after raising a GitHub issue.Peter V

1 Answers

1
votes

I had a similar issue, however it was fixed after raising a GitHub issue.