Visibility timeout — the silent-worker clock

Because the broker cannot tell a slow worker from a dead one, every leased message carries a countdown; if no ack arrives before it expires, the broker assumes the worker is dead and redelivers — guaranteeing at-least-once delivery and, eventually, duplicates.

Previously

Delivery count climbs when consumers nack — but silent workers never nack. The broker needs a second clock that catches workers that don't say anything, succeed or fail.

Scene 09

Visibility timeout — the broker's silent-worker clock

  1. Watch
  2. Try it
  3. Predict
  4. Capture
producerenqueueVISIBILITY TIMEOUT30s c-0c-1c-2c-3c-4c-5c-6c-7c-8WORKERS · 3processing —Worker 1processing —Worker 2processing —Worker 3DUPLICATE SIDE EFFECTS0 (timeout fired while worker still processing)
What to watch for

Worker 1 grabs the head cell — its 30-second countdown starts. The processing bar finishes in 10 seconds, ack fires, the cell vanishes. Then watch what happens when a worker is slower than the timeout: the countdown hits zero, the broker hands the same cell to a peer, both eventually ack, and the red duplicate counter ticks up.

Continue unlocks when the animation finishes.

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

Scene 09 of 14. Per-message countdown; if no ack arrives, the broker redelivers. Too short → duplicates; too long → stuck pool; heartbeat extend is the fix.

Up next. Each cell now has its own countdown — and the broker has to remember every grey cell, per worker. How many can it carry in flight? That cap is the next knob: prefetch.

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