AMQP dead-letter routing narrated tour
AMQP dead-letter routing narrated tour
AMQP dead-letter routing narrated tour
Play silently with captions on provisional storyboard timing; narration audio is pending. Production pacing is not protocol time. Choose Reduced motion for a complete still at each beat.
Play the tour to open the workbench. Pause, replay a beat, or read the full transcript below. Some situations cannot be shown by this teaching model; those beats keep the existing frame and provide captions only.
Full transcript — AMQP dead-letter routing (8 beats)
B1 — Unreadable payload
You are the engineer keeping a factory's sensor messages moving. A decoder cannot read one message's payload, the data it carries. If that bad message keeps returning to the main queue, it can block good traffic. How do you move it aside while keeping the details needed to repair the fault?
Model caption: An unreadable sensor payload can block useful work if it keeps returning to the main queue.
B2 — Dead-letter route
Dead-lettering gives failed work another route. A queue configured with a dead-letter exchange republishes the message to that exchange. An exchange routes messages onward using a routing key. For your failed sensor message, that route separates the failure from the main flow of work.
Model caption: A configured source queue republishes failed work to a dead-letter exchange.
B3 — Failure triggers
Rejection without returning the message to the source queue can trigger dead-lettering. So can expiry of its time to live, meaning its allowed lifetime. Queue overflow is another trigger: exceeding a length limit drops the oldest message by default.
Model caption: Rejection without requeue, lifetime expiry, or length overflow can trigger the chapter's dead-letter route. Overflow drops the oldest message by default.
B4 — Routing and evidence
The dead-letter route uses a configured replacement routing key when one is set. Otherwise, it uses the original routing key. The broker adds failure details in a header called x-death. Those details include the reason, source queue and count. The count helps a retry policy decide when to stop.
Model caption: A replacement routing key is used when configured; otherwise the original key is used. The x-death header carries failure context for the retry policy.
B5 — Retry delay example
Take the chapter's decoder example. The decoder rejects the unreadable payload without requesting a return to the source queue. The dead-letter exchange routes it to a retry queue with a thirty-second lifetime. After thirty seconds, that queue dead-letters the message back to the main exchange for another attempt.
Model caption: Chapter example: rejected payload → retry queue; wait thirty seconds → main exchange for another attempt.
B6 — Parking after failures
Suppose the message reaches three failed attempts. The handler can send it to a parking queue for investigation. The original body and headers stay with it. The failure reason and source queue are preserved too. Your bad sensor message is set aside with the context needed for repair.
Model caption: After three failed attempts, the handler can park the message. Preserve its body and headers, plus the failure reason and source queue, for investigation.
B7 — Routing is not repair
The misconception is that dead-lettering repairs the failed message automatically. Moving an unreadable payload to another queue does not make the decoder able to read it. In the example, the retry policy uses the failure history to stop after three failed attempts and send the message to parking.
Model caption: Dead-lettering moves failed work. The example's retry policy stops after three failures; repair still requires investigation.
B8 — Failure route takeaway
Give failed work a route, a retry limit and a place to stop with its failure details intact.
Model caption: Give failed work a route, a retry limit and a place to stop with its failure details intact.