Middle
Does Kafka guarantee message delivery? Provide a real-life example.
sobes.tech AI
Answer from AI
Kafka guarantees message delivery through acknowledgment (acks) settings and retry mechanisms.
- With
acks=all, the producer waits for confirmation from all replicas, ensuring reliable delivery. - If a message is not acknowledged, it will be resent.
An example from real life: imagine a parcel delivery service that requires the recipient's signature (confirmation). Until the signature is received, the parcel is not considered delivered, and the courier may attempt to deliver it again. Similarly, Kafka guarantees that a message will be delivered and acknowledged before considering it sent.