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.
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
- Watch
- Try it
- Predict
- Capture
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.
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