
Answer-first summary for fast verification
Answer: Adjust the visibility timeout with ChangeMessageVisibility API.
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.
Author: LeetQuiz Editorial Team
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?
A
Utilize CreateQueue API to establish a new queue.
B
Implement AddPermission API to set correct permissions.
C
Configure ReceiveMessage API for an optimal wait time.
D
Adjust the visibility timeout with ChangeMessageVisibility API.
No comments yet.