SQS Is Delivering the Same Message Twice. Is the Queue Broken?
Consumers occasionally process the same SQS message twice, causing double charges. A teammate says switch everything to FIFO. Defend the real fix.
Answer key reviewed by Branko Petric
Read first: AWS Fundamentals for DevOps
Your decision
Your workers sometimes process the same SQS message twice, leading to duplicate charges and emails. A teammate says standard SQS is broken and wants to move everything to FIFO. What is actually happening, and what do you do?
The situation
A small fraction of jobs in your queue-driven system run twice. Because each job charges a card and sends a receipt, the duplicates show up as double charges and duplicate emails to customers.
Context
Workers poll a standard SQS queue, do work that can take a couple of minutes, then delete the message. The queue visibility timeout is set to thirty seconds. There is no dead-letter queue and the processing has no dedup or idempotency key. A teammate concluded that standard SQS is unreliable and wants to migrate every queue to FIFO.
Related challenges
- Your S3 Website Returns 403. Make the Bucket Public?
Objects in S3 return 403 and a teammate wants to turn off Block Public Access to fix it fast. Defend the right way to grant access.
- The t3 Instance Got Slow. Just Size It Up?
An app on a t3 instance crawls under steady load and a teammate wants a bigger instance. Defend what is actually throttling it.
- Access Keys Are Hardcoded on the EC2 Box. Just Rotate Them?
An app on EC2 authenticates to AWS with long-lived IAM user keys in a config file. One leaked. Defend the real fix.
- Lambda Is Exhausting Your RDS Connections. Raise the Limit?
Under load, Lambda functions fail with too many connections to RDS. A teammate wants to bump max_connections. Defend the real fix.