A developer is implementing a transaction processing system using an Amazon SQS FIFO queue. The system must process transactions in the exact order they occur. During testing, the developer notices that when two different transactions with identical message bodies are sent within two minutes of each other, the second transaction is discarded. Content-based deduplication is disabled on the queue. How should the developer modify the application configuration or message attributes to ensure both transactions are processed?
- AIncrease the VisibilityTimeout parameter on the queue to be greater than five minutes.
- BConfigure the consumer Lambda function's timeout parameter to match the SQS message retention period.
- Set a unique MessageDeduplicationId parameter on each sent message.Answer
- DInitialize the AmazonSQS client using hardcoded AWS access keys to bypass SQS message deduplication checks.
Answer
Set a unique MessageDeduplicationId parameter on each sent message.
Setting a unique MessageDeduplicationId on each sent message ensures that Amazon SQS treats transactions with identical bodies as distinct messages, preventing incorrect deduplication when content-based deduplication is disabled.
Step-by-Step Solution
Key Concept
SQS FIFO Message Deduplication