AlgoMaster Logo

Dead Letter Queues

Medium Priority11 min readUpdated July 4, 2026
AI Mock Interview

Practice this topic in a realistic system design interview

Retries are useful when a failure might go away on its own. A network timeout, a busy database, or a short service outage is worth retrying.

Some failures are different. A message may have bad data, point to a record that no longer exists, break a business rule, or hit a bug in the consumer. Retrying that message forever wastes worker time and can stop later messages from moving forward.

A dead letter queue (DLQ) is where a messaging system puts messages that failed too many times. It keeps the main queue moving, while saving the failed messages so someone can inspect, fix, replay, or delete them.

The important idea is simple:

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

This chapter covers how dead letter queues work, when messages land there, and how to handle them.

1. What Is a Dead Letter Queue?

A dead letter queue is a separate queue, topic, or stream that receives messages after normal processing has failed too many times. Some brokers also let the consumer send a message to the DLQ directly when retrying would not help.

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 using worker capacity forever. In FIFO or ordered systems, it can also prevent a "poison message" from blocking everything behind it. A poison message is a message that fails every time it is processed.

2. Why Messages Reach a DLQ

Premium Content

This content is for premium members only.