AWS Certified Developer – Associate — Question 109
A developer deploys a custom application to three Amazon EC2 instances. The application processes messages from an Amazon Simple Queue Service (Amazon SQS) standard queue with default settings. When the developer runs a load test on the Amazon SQS queue, the developer discovers that the application processes many messages multiple times.
How can the developer ensure that the application processes each message exactly once?
Answer options
- A. Modify the SQS standard queue to an SQS FIFO queue.
- B. Process the messages on one EC2 instance instead of three instances.
- C. Create a new SQS FIFO queue. Point the application to the new queue.
- D. Increase the DelaySeconds value on the current SQS queue.
Correct answer: C
Explanation
The correct answer is C because creating a new SQS FIFO queue ensures that messages are processed in order and exactly once, as FIFO queues are designed to prevent duplicates. Option A is incorrect because modifying the existing queue type does not guarantee that the application will process each message only once if it already has multiple instances. Option B might reduce duplication but does not resolve the inherent issue with the standard queue. Option D only adds a delay but does not prevent multiple processing of the same message.