AlgoMaster Logo

Dead Letter Queues

Last Updated: May 27, 2026

Ashish

Ashish Pratap Singh

Medium Priority
8 min read

Retries are useful only when a failure might go away. A network timeout, a busy database, or a temporary service outage is worth retrying.

Some failures are different. A message may have invalid data, refer to an object that no longer exists, violate a business rule, or trigger a bug in the consumer. Retrying that message forever wastes capacity and can stop later messages from making progress.

A dead letter queue (DLQ) is where a messaging system puts messages that cannot be processed through the normal path. It keeps the main queue moving while preserving failed messages for investigation, repair, replay, or deletion.

The important idea is simple:

A DLQ is not where messages go to be forgotten. It is a quarantine area for messages that need a decision.

What Is a Dead Letter Queue?

A dead letter queue is a separate queue, topic, or stream that receives messages after normal delivery has failed too many times or the broker has been told not to redeliver them.

The exact mechanism depends on the messaging system, but the pattern is the same:

The normal flow is:

  1. A message arrives in the main queue.
  2. A consumer tries to process it.
  3. If processing fails, the message is retried.
  4. After the retry policy is exhausted, the message is moved to the DLQ.
  5. The main queue continues processing other messages.

This prevents one bad message from consuming worker capacity forever. In FIFO or ordered systems, it can also prevent a poison message from blocking everything behind it.

Why Messages Reach a DLQ

Premium Content

This content is for premium members only.