Build a Message Queue (RabbitMQ / SQS) (14 scenes)
Scene 06 · Nack and requeue — the failure verdict
Three consumer verdicts (ack / nack-with-requeue / reject-without-requeue) — and requeue-forever is a footgun.
Previously
Ack handles the happy path: 'I succeeded.' The error path needs its own verdict — and it has two flavors, depending on whether we still believe the message can succeed if we try again.
Scene 06
Nack and requeue — the failure verdict
Diagram
A queue strip with workers on the right. Each worker can now return one of three verdicts on a picked cell: **ack** ('I succeeded — delete it'), **nack** with requeue=true ('I failed — put it back at the head so someone else can try'), or **reject** with requeue=false ('I failed — drop it, do not redeliver'). A cell that has been picked but not yet verdicted is **in flight** (dashed, grey) — the broker holds it but no one else can take it.
Watch a worker take a cell from the head. Instead of acking, it nacks with requeue=true — the cell goes bright again at the head, and another worker picks it up. Then a worker rejects a cell with requeue=false — that cell vanishes into the discarded lane and never comes back.