Development with AWS Services

An Amazon SNS subscription delivers JSON order messages to Amazon SQS with raw message delivery disabled. After parsing the SQS message body, how should a consumer obtain the order object?

Show the answer

Correct answerB. Parse the SNS Message field as JSON.

AWhy not this: MessageId identifies the SNS message; it does not contain the order payload.

BWhy this is right: The Message field contains the original published JSON as a string, requiring another JSON parse.

CWhy not this: Message attributes contain metadata, not the published order body.

DWhy not this: SNS does not automatically Base64-encode the published JSON in the Message field.

Without raw message delivery, SNS wraps the published message in a JSON notification envelope. Parsing the SQS body exposes that envelope; parsing its Message string produces the original order object. Message attributes are separate metadata.