Delivery Guarantees: At-Least-Once
Learn the concept of at-least-once delivery in event brokers and explore its benefits, trade-offs, and code examples in a Kafka-based system.
We'll cover the following...
At-least-once delivery means that the broker will ensure that a produced event is delivered at least once (still obvious, right?). What this means is that all consumers can read the event, and the broker will continue to deliver it to any other consumer until such a time as a consumer acknowledges it has processed the event. It’s at-least-once delivery, so there’s a possibility that an event might be delivered more than once.
The Producer must wait for acknowledgment from the broker that an event is received. If the broker doesn’t acknowledge successful receipt, then the Producer will repeatedly try until it does. This adds a throughput overhead, which will impact performance and scalability. However, this also ensures an event is received by the broker as is required for the at-least-once delivery.
Any Consumer that reads the event that crashes or fails before it completes its work ...