What it is
Guaranteed delivery ensures a message is not lost even if the sender, broker, or receiver crashes. The messaging system writes the message to durable storage and keeps it until delivery is confirmed.
How it works
- The broker persists the message to disk before acknowledging the sender.
- It retains the message until the receiver acknowledges processing.
- After a crash, the broker recovers unacknowledged messages and retries.
Why it matters
- Protects against data loss for critical messages like orders or payments.
- Lets producers and consumers run on different schedules safely.
- Turns transient failures into retries instead of lost work.
The cost is performance and storage: writing to disk and waiting for acknowledgements adds latency. Guaranteed delivery usually gives at least once semantics, so a message may be delivered more than once after a recovery. Consumers therefore need to be idempotent so a redelivery does not cause double effects. Stronger exactly once guarantees require extra coordination.
Key idea
Guaranteed delivery persists messages durably and retries until acknowledged, usually giving at least once delivery that demands idempotent consumers.