Build a Message Queue (RabbitMQ / SQS) (14 scenes)
Scene 07 · The poison message — the loop that won't end
A naive requeue loop turns one un-processable message into an infinite redelivery storm that pegs CPU and starves the queue 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
Diagram
A FIFO queue laid out head-on-the-left, tail-on-the-right. Workers on the right pull from the head. Every cell carries a small badge in its top-right corner: the delivery-count — how many times the broker has handed this message out. Below the workers, a CPU meter shows the cost of the whole pool.
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.