AWS Certified Solutions Architect – Associate (SAA-C02) — Question 309
A solutions architect is redesigning a monolithic application to be a loosely coupled application composed of two microservices: Microservice A and Microservice
B.
Microservice A places messages in a main Amazon Simple Queue Service (Amazon SQS) queue for Microservice B to consume. When Microservice B fails to process a message after four retries, the message needs to be removed from the queue and stored for further investigation.
What should the solutions architect do to meet these requirements?
Answer options
- A. Create an SQS dead-letter queue. Microservice B adds failed messages to that queue after it receives and fails to process the message four times.
- B. Create an SQS dead-letter queue. Configure the main SQS queue to deliver messages to the dead-letter queue after the message has been received four times.
- C. Create an SQS queue for failed messages. Microservice A adds failed messages to that queue after Microservice B receives and fails to process the message four times.
- D. Create an SQS queue for failed messages. Configure the SQS queue for failed messages to pull messages from the main SQS queue after the original message has been received four times.
Correct answer: B
Explanation
An Amazon SQS dead-letter queue (DLQ) is the native and most efficient way to handle message processing failures by automatically isolating messages after a specified number of unsuccessful attempts (maxReceiveCount). Configuring the redrive policy on the primary SQS queue ensures AWS manages the redirection automatically, avoiding extra development overhead. Options involving microservices manually handling the redirection or queues pulling from other queues are architecturally incorrect and inefficient.