The poison message — the loop that won't end

A naive requeue-on-failure loop turns one un-processable message into an infinite redelivery storm that pegs the workers' CPU and blocks every healthy message behind it.

Previously

Requeue tries again. But some messages cannot succeed — malformed JSON, a deleted referenced row, a schema rollover. The strip oscillates forever on those cells, and we just watched the CPU bill climb.

Scene 07

The poison message — the loop that won't end

  1. Watch
  2. Try it
  3. Predict
  4. Capture
producer+ 1 poisonheadtailpoison-00h-00h-10h-20h-30h-40h-50h-60h-70WORKERS · 4Worker 1Worker 2Worker 3Worker 4WORKER CPU20%
What to watch for

One red cell at the head is a poison message — it always throws when processed. Watch the workers grab it, fail, and nack-requeue. The cell returns to the head with delivery-count + 1. The badge climbs; the CPU meter pegs; the healthy cells behind it never move.

Continue unlocks when the animation finishes.

Where this sits in Build a Message Queue (RabbitMQ / SQS)

Scene 07 of 14. A naive requeue loop turns one un-processable message into an infinite redelivery storm that pegs CPU and starves the queue behind it.

Up next. The fix has to live in the broker, not the consumer: after the delivery-count badge hits some threshold, the broker should route this message somewhere it cannot poison the main pool.

All 14 scenes in Build a Message Queue (RabbitMQ / SQS) · Every curriculum

Built with Arqly
Every scene in Build a Message Queue (RabbitMQ / SQS) builds on the one before it.All 14 Build a Message Queue (RabbitMQ / SQS) scenes