← Lessons

quiz vs the machine

Gold1400

System Design

The Dead Letter Exchange

Where messages go when they cannot be delivered or keep failing, so nothing is silently lost.

4 min read · core · beat Gold to climb

A place for failures to land

When a message cannot be processed, dropping it loses data and retrying it forever blocks the queue. A dead letter queue, reached through a dead letter exchange, is a separate destination where the broker parks messages that cannot proceed.

What sends a message there

  • It was rejected or nacked too many times.
  • It expired past its time to live.
  • The queue hit a length limit and overflowed.

Instead of vanishing, such a message is rerouted to the dead letter target along with metadata about why it failed.

Why it helps

  • It unblocks the main queue so healthy messages keep flowing.
  • It preserves the failed message for inspection, replay, or alerting.
  • Operators can fix the root cause and then redrive dead lettered messages back to the main queue.

Key idea

A dead letter exchange reroutes undeliverable or repeatedly failing messages to a safe queue so the main flow stays healthy and nothing is lost.

Check yourself

Answer to earn rating on the learn ladder.

1. What is a main purpose of a dead letter queue?

2. Which event would send a message to a dead letter exchange?