At-least-once delivery
A queue or broker guarantee that every message arrives, possibly more than once, so consumers must handle duplicates.
A message is removed only after the consumer confirms it. If the consumer crashes after doing the work but before confirming, the message comes back and is processed again. The other options are at-most-once (fire and forget, messages can be lost) and exactly-once, which in practice means at-least-once plus idempotent processing. Most queues, webhooks and outbox relays deliver at least once.
Related terms
- Idempotency (idempotency key): An operation is idempotent if doing it twice has the same effect as doing it once. Retries become safe.
- Dead letter queue (DLQ): A separate queue where messages land after failing processing too many times, so they are kept instead of lost or retried forever.
- Exactly-once delivery: The promise that each message has its effect once; in practice, at-least-once delivery plus processing that ignores duplicates.
- Inbox pattern (idempotent consumer): A consumer records the id of each processed message in the same transaction as its own change, and skips any id it has already seen.
