Amazon SQS

Dead-Letter Queues

Isolate messages that repeatedly fail so they stop blocking the queue and can be investigated.

An SQS dead-letter queue (DLQ) is an ordinary queue designated as the destination for messages that fail processing too many times. You attach a redrive policy to the source queue specifying a DLQ and a maxReceiveCount; once a message has been received (and not deleted) that many times, SQS moves it to the DLQ automatically.

A returns desk in a warehouse: a package that fails delivery a few times is pulled off the normal conveyor and set aside in a dedicated area where staff examine why, fix it, and re-introduce it — instead of it circling the belt forever.

Key Concepts

1
This prevents poison messages — ones that always fail — from being redelivered endlessly, consuming throughput and blocking healthy traffic. The DLQ becomes a quarantine you can monitor, alarm on (queue depth > 0), inspect, fix, and optionally redrive back to the source queue once the underlying bug is resolved.
2
A FIFO source queue must use a FIFO DLQ, and a Standard source a Standard DLQ. It is also good practice to set a longer retention on the DLQ than the source so you have time to react.
3
What the interviewer is probing.
What the interviewer is probing.
4
1. "What sends a message to the DLQ?" *Probing:* the mechanism. *Stalls:* "An error." *Moves up:* exceeding maxReceiveCount — the receive count, not an explicit failure, which means a consumer crash counts the same as a rejection.
1. "What sends a message to the DLQ?"
5
2. "What maxReceiveCount would you set?" *Probing:* the practical answer. *Stalls:* "One." *Moves up:* typically three to five — enough to survive transient failure, few enough that a poison message is parked quickly.
2. "What maxReceiveCount would you set?"
6
3. "What do you do with the DLQ?" *Probing:* the operational point. *Stalls:* "Nothing." *Moves up:* alarm on its depth and have a documented redrive path — an unmonitored DLQ is silent data loss.
3. "What do you do with the DLQ?"
7
4. "What is a common configuration mistake?" *Probing:* experience. *Stalls:* "None." *Moves up:* a DLQ retention shorter than the main queue, so parked messages expire before anyone investigates.
4. "What is a common configuration mistake?"