Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon SNS -> SQS message body

I'm sending a message from an SNS topic to an SQS. When I'm checking the body of the SQS message on my client, the whole of the message metadata is being sent in the SQS body.

I.E. if I'm sending a message "Hello World" from the topic, my client is receiving:

    BenFlowers {
  "Type" : "Notification",
  "MessageId" : "84102bd5-8890-4ed5-aeba-c15fafc926dc",
  "TopicArn" : "arn:aws:sns:eu-west-1:534706846367:HelloWorld",
  "Message" : "hello World",
  "Timestamp" : "2012-06-05T13:44:22.360Z",
  "SignatureVersion" : "1",
  "Signature" : "Qzh0qXhijBKylaFwc9PGE+lQQDwHGWkIzCW2Ld1eVrxNfSem4yyBTgouqGX26V0m1qhFD4RQcBzE3oNqx5jFhJfV4hN45FNcsFVnmfLPGNUTmJWblSk8f6znWgTy8UtK9xrTeNYzK59k3VJ4WTJ5kCEj+2vH7sBV15fAXeCAtdQ=",
  "SigningCertURL" : "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem",
  "UnsubscribeURL" : "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:534706846367:HelloWorld:8a3acde2-cb0b-4a56-9b9c-b75ed7307556"
}

This is a bit annoying as I am having to split the message body up on the other end. Speed is pretty important in this application so i would like to eliminate this. Is there any way to just send the message from the SNS and ignore the rest of the metadata?

Thanks, Ben

like image 443
Ben Flowers Avatar asked Jun 05 '12 13:06

Ben Flowers


People also ask

What is message body SQS?

Amazon SQS provides support for message attributes. Message attributes allow you to provide structured metadata items (such as timestamps, geospatial data, signatures, and identifiers) about the message. Message attributes are optional and separate from, but sent along with, the message body.

How does SNS and SQS work together?

When you subscribe an Amazon SQS queue to an Amazon SNS topic, you can publish a message to the topic and Amazon SNS sends an Amazon SQS message to the subscribed queue. The Amazon SQS message contains the subject and message that were published to the topic along with metadata about the message in a JSON document.

What is difference between SNS and SQS?

SQS is mainly used to decouple applications or integrate applications. SNS is used to broadcast messages and it's up to the receivers how they interpret and process those messages.


1 Answers

SNS recently rolled out a feature that allows you to set 'raw message delivery' on an SNS topic.

http://docs.aws.amazon.com/sns/latest/dg/large-payload-raw-message.html

like image 173
prestomation Avatar answered Oct 05 '22 07:10

prestomation