acks=0/1/all, retries and the idempotent producer: how do you configure Kafka to neither lose nor duplicate messages?
Short answer
No message loss: acks=all, a topic with RF=3 and min.insync.replicas=2, retries bounded by delivery.timeout.ms. Retries without duplicates or reordering: enable.idempotence=true (the default since Kafka 3.0).
3 points to say:
acks=all+ RF=3 +min.insync.replicas=2, and disable unclean leader election.- Idempotence (default since 3.0, in-flight ≤ 5): the broker uses producer id + sequence number to drop duplicates.
- Bound retries by time, not by count; on the consumer side disable auto-commit, commit after processing, stay idempotent.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.