AWS Certified Solutions Architect – Associate (SAA-C02) — Question 380
A company is Re-architecting a strongly coupled application to be loosely coupled. Previously the application used a request/response pattern to communicate between tiers. The company plans to use Amazon Simple Queue Service (Amazon SQS) to achieve decoupling requirements. The initial design contains one queue for requests and one for responses. However, this approach is not processing all the messages as the application scales.
What should a solutions architect do to resolve this issue?
Answer options
- A. Configure a dead-letter queue on the ReceiveMessage API action of the SQS queue.
- B. Configure a FIFO queue, and use the message deduplication ID and message group ID.
- C. Create a temporary queue, with the Temporary Queue Client to receive each response message.
- D. Create a queue for each request and response on startup for each producer, and use a correlation ID message attribute.
Correct answer: C
Explanation
Using a single response queue for multiple scaling instances causes messages to be consumed by the wrong requesters. The Amazon SQS Temporary Queue Client resolves this by automatically creating lightweight, temporary queues for each response, ensuring messages are routed back to the correct requester. Other options, like FIFO queues or dead-letter queues, do not solve the request-response routing problem at scale, while creating permanent queues on startup is not cost-effective or manageable.