- SNS Topic with "Enable Raw Message Delivery" enabled.
- Pre-created SQS resource with the (I think) correct policy.
- Pre-created SNS topic with the (I think) correct policy.
- Pre-created subscription with SQS/SNS with the (I think) correct policy.
My Golang service publishes to SNS topic with one Message Attribute OR use web client to publish to SNS topic with the same Message Attribute. Either way, the end result is the same.
Service code (Golang) contains the following block for receiving messages:
var ( all = "All" ) output, err := c.sqs.ReceiveMessage(&sqs.ReceiveMessageInput{ QueueUrl: &c.QueueURL, MaxNumberOfMessages: &maxMessages, AttributeNames: []*string{aws.String(sqs.MessageSystemAttributeNameApproximateFirstReceiveTimestamp)}, MessageAttributeNames: []*string{&all}, })
If I receive messages on AWS SQS web page then review each message on the web page, I see the Message Attributes on each message. However, if I run my Golang application, the MessageAttributes is always nil. I see the "regular" Attributes but not the Message Attributes.
Next, I tried aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/my-queue-url --attribute-name SenderId SentTimestamp --message-attribute-name ALL --max-number-of-messages 2
. This too DID NOT have Message Attributes.
In both cases, the rest of the data is correct.
What would exclude the aws cli and my service from receiving the Message Attributes?