Try
↑ ↓ move↵ openesc close

Interview prep / Delivery guarantees

Mid · Delivery guarantees · System design interview question

Name the ways a consumer can end up processing the same message twice without any crash.

Sketch your own answer first, then compare it with the one below.

A strong answer

A slow consumer is the main one. If processing takes longer than the ack timeout, the broker redelivers while the first attempt is still running, and both finish.

Others include a lost ack, where the consumer finished but the ack never reached the broker. A producer that retries a send that did succeed leaves two copies in the queue. A rebalance or failover can hand the same message to a second consumer. A replay deliberately repeats history.

So duplicates are routine, not rare. That argues for an idempotent consumer, not for hoping the timeouts are tuned right.

Sources

Learn it by running it

The delivery guarantees lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms