nerdexam
Amazon

DVA-C02 · Question #717

A developer deploys an Amazon SNS topic and creates a subscription for an Amazon SQS queue. An AWS Lambda function processes messages in the SQS queue. The Lambda function deserializes each message…

The correct answer is B. Enable raw message delivery on the SQS subscription. Enabling raw message delivery on the SNS subscription to the SQS queue ensures that the message is delivered without SNS JSON wrapping. This allows the Lambda function to receive and deserialize the original JSON object correctly.

Submitted by deeparc· Mar 5, 2026Troubleshooting and Optimization

Question

A developer deploys an Amazon SNS topic and creates a subscription for an Amazon SQS queue. An AWS Lambda function processes messages in the SQS queue. The Lambda function deserializes each message body and processes the resulting object. When the developer tests the solution, a JSON object is published to the SNS topic. However, the Lambda function returns an error when the function attempts to deserialize the message body. The error states that the message is not valid JSON. The developer must resolve the error. Which solution will meet this requirement?

Options

  • AAdd an access policy to the SQS queue to allow the SNS topic to perform the sqs:SendMessage
  • BEnable raw message delivery on the SQS subscription.
  • CAdd an access policy to the SNS topic to allow the SNS topic to perform the sqs:SendMessage
  • DSet a RawMessageDelivery attribute on the SNS message.

How the community answered

(46 responses)
  • A
    4% (2)
  • B
    72% (33)
  • C
    9% (4)
  • D
    15% (7)

Explanation

Enabling raw message delivery on the SNS subscription to the SQS queue ensures that the message is delivered without SNS JSON wrapping. This allows the Lambda function to receive and deserialize the original JSON object correctly.

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice