# Dead Letter Queue (DLQ)

> A side queue for failed messages. Now they stop blocking the rest.

**Field:** Software Development  
**Category:** Integration & Automation  
**Also known as:** DLQ, Dead-Letter Queue, Dead Letter Exchange

## Think of it like

Think of it like a box at the post office. Letters that cannot be sent wait there for a person.

## Definition

A dead letter queue is a side queue for messages that keep failing. A worker tries a message, and it fails. After a set number of tries, the message moves to the side queue. The main queue keeps flowing, so one bad message does not block the rest. A person then looks at the failed message, fixes the cause and sends it again.

## Example

On Amazon SQS, the setting maxReceiveCount says how many tries a message gets. Jack sets it to 5, so a message that fails five times moves to his DLQ.

## Why it matters

Without one, a bad message is either lost or retried forever. Both hide the real problem.

## Common mistake

Setting up a DLQ and never looking at it. Add an alarm, or failed orders pile up for weeks.

## Three principles

- **Set the tries.** Choose how many fails moves a message.
- **Keep the line moving.** Bad messages step aside.
- **Alarm and replay.** Watch it, fix it, then send again.

## Related terms

- [Message Queue](https://learn.benibix.com/term/development/message-queue)
- [Retry with Exponential Backoff](https://learn.benibix.com/term/development/retry-with-backoff)
- [Idempotency](https://learn.benibix.com/term/development/idempotency)
- [Webhook](https://learn.benibix.com/term/development/webhook)
- [Task Retry](https://learn.benibix.com/term/data/task-retry)

![A main queue of messages feeds a worker. One message fails three times, shown as three crossed tries. After the third try it moves down into a separate box, lit up, called the dead letter queue. An alarm bell sits beside that box, and a curved arrow labelled send again after the fix leads back to the main queue. The other messages keep flowing to the worker.](https://learn.benibix.com/diagrams/dev3-dead-letter.svg)

---

Source: https://learn.benibix.com/term/development/dead-letter-queue
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
