A developer is designing a backend report generation system where users can request custom PDF reports. Due to network latency, the client application occasionally retries request submissions, resulting in duplicate messages being sent to the integration queue. The developer wants to ensure that if a request with the exact same payload is sent within a 5-minute window, the duplicate message is discarded and not processed. Which configuration will meet this requirement with the least development effort?
- Create an Amazon SQS FIFO queue and enable content-based deduplication on the queue.Answer
- BCreate a standard Amazon SQS queue and set the visibility timeout to 300 seconds.
- CCreate a standard Amazon SQS queue, configure an AWS Lambda function consumer, and set the Lambda execution timeout to 300 seconds.
- DCreate an Amazon SQS FIFO queue and assign the user's IP address as the MessageGroupId for all messages.
Answer
Create an Amazon SQS FIFO queue and enable content-based deduplication on the queue.
Creating an Amazon SQS FIFO queue and enabling content-based deduplication is the most effective approach. When content-based deduplication is enabled, SQS automatically generates a SHA-256 hash of the message body to serve as the Message Deduplication ID. Any messages with the same body sent within the 5-minute deduplication window are recognized as duplicates and discarded.
Step-by-Step Solution
Key Concept
Amazon SQS FIFO Queue Content-Based Deduplication