What guarantees of delivery have you encountered in Kafka, and in what cases are they used?
sobes.tech AI
Answer from AI
Kafka has three main message delivery guarantees:
-
At most once — a message may be delivered 0 or 1 times. Used when message loss is acceptable but duplication is not.
-
At least once — a message will be delivered guaranteed, but may be delivered multiple times (duplicates possible). This is the most common mode when delivery reliability is important.
-
Exactly once — a message is delivered exactly once without duplicates. Implemented using Kafka transactions and idempotent producers.
An example of using the exactly-once guarantee is relevant in financial systems where avoiding transaction duplication is critical. At least once is suitable for logging and analytics where data completeness is important, and at most once for less critical notifications.
In Kafka Go clients (e.g., sarama), these modes can be configured through producer parameters and acknowledgment handling.