Q53 — AWS DOP-C02 Ch.3
Question 53 of 100 | ← Chapter 3
A space exploration company receives telemetry data from multiple satellites. Data packets are received via Amazon API Gateway and delivered directly to an Amazon Simple Queue Service (Amazon SQS) standard queue. A corresponding application subscribes to the queue and converts the data into a standardized format. Due to inconsistent data from satellites, the application sometimes fails to convert the data. In such cases, messages remain in the SQS queue. A DevOps engineer needs to develop a solution to retain failed messages and allow scientists to review and further process them. Which solution meets these requirements?
- A. Configure AWS Lambda to poll the SQS queue and invoke a Lambda function to validate queue messages. If validation fails, send a copy of the invalid data to an Amazon S3 bucket for scientists to review and correct. After correction, use a replay Lambda function with corrected data to modify the message in the SQS queue.
- B. Convert the SQS standard queue to an SQS FIFO queue. Configure AWS Lambda to poll the SQS queue every 10 minutes using an Amazon EventBridge schedule. Invoke the Lambda function to identify any messages with SentTimestamp older than 5 minutes, push the data to the same output location as the application, and remove the messages from the queue.
- C. Create an SQS dead-letter queue (DLQ). Modify the existing queue with a redrive policy that sets Maximum Receives to 1 and specifies the ARN of the newly created DLQ. Instruct scientists to use the DLQ to inspect invalid data and reprocess it later. ✓
- D. Configure API Gateway to send messages to different SQS virtual queues named for each satellite. Update the application to route any data it cannot convert to a new virtual queue and send messages there. Instruct scientists to use the virtual queue to inspect invalid data and reprocess it later.
Correct Answer: C. Create an SQS dead-letter queue (DLQ). Modify the existing queue with a redrive policy that sets Maximum Receives to 1 and specifies the ARN of the newly created DLQ. Instruct scientists to use the DLQ to inspect invalid data and reprocess it later.
Explanation
AWS SQS dead-letter queues (DLQs) are designed to store messages that consumers fail to process correctly. In this scenario, when the application fails to convert data, messages remaining in the original queue risk infinite retries or unintended deletion. By configuring Maximum Receives to 1, messages failing processing on their first attempt are automatically routed to the DLQ. This isolates failed messages for independent inspection and reprocessing without blocking the primary queue. AWS documentation identifies DLQs as the standard, native mechanism for handling failed messages—requiring no custom logic or additional services. Option C leverages this built-in capability directly. Other options introduce unnecessary complexity (e.g., S3, EventBridge) or non-standard approaches (e.g., virtual queues), increasing operational overhead.