Comparison
At-least-once deliveryvsAt-most-once delivery
At-least-once delivery
the worker processed the message, crashed before acknowledging it, and the queue handed the same message to somebody else.
A guarantee that every message is delivered, possibly more than once. It is the default in nearly every broker, because acknowledging after processing is the only way to survive consumer crashes. It makes duplicate handling the consumer's problem, which is why an at-least-once consumer that is not idempotent is a bug waiting for a redeploy.
Full entry →At-most-once delivery
you acknowledge the message first and then process it, so a crash mid-processing means it is simply gone.
A guarantee that a message is never delivered twice, and may be delivered zero times. It is the cheapest option and the right one for high-volume telemetry where a lost sample does not matter. It is the wrong one for anything a user paid for or is waiting on.
Full entry →