AWS Certified Solutions Architect - Associate

AWS Certified Solutions Architect - Associate

Get started today

Ultimate access to all questions.


A company's application on Amazon EC2 instances processes messages from an SQS queue, updates an RDS table, and then deletes the messages. Despite no duplicates in the queue, duplicates appear in the RDS table. How can a solutions architect ensure single-message processing?




Explanation:

The correct answer is D. When an application processes a message from an SQS queue but occasionally creates duplicate records in the database despite no duplicate messages in the queue, it is often due to the visibility timeout being too short. If the processing of a message takes longer than the visibility timeout, the message might become visible in the queue again before the processing completes, leading to duplicate processing. By increasing the visibility timeout using the ChangeMessageVisibility API, you ensure that once a message is picked up by a consumer, it has enough time to be processed completely before becoming visible to other consumers.