Senior
What delivery guarantees have you encountered in Kafka?
sobes.tech AI
Answer from AI
There are three main message delivery guarantees in Apache Kafka:
-
At most once: A message may be delivered 0 or 1 times. Loss of messages is possible, but duplicates will not occur.
-
At least once: A message will be delivered at least once, but duplicates may occur if the consumer does not acknowledge receipt in time and the message is resent.
-
Exactly once: A message is delivered and processed exactly once without duplicates. In Kafka, this is achieved using idempotent producers and transactions.
In practice:
- Kafka defaults to "at least once".
- To achieve "exactly once," additional configurations and transaction APIs are required.
Understanding these guarantees is important for building reliable data processing systems where message loss or duplication can have critical consequences.