Quick revision
The short answer
acks=0 sends without waiting for the broker, acks=1 waits for the partition leader to write the record, and acks=all waits until all in-sync replicas have it, while min.insync.replicas is a topic or broker setting that says how many in-sync replicas must exist for an acks=all write to be accepted. Since Kafka 3.0 the producer defaults are acks=all and enable.idempotence=true. acks=0 can lose anything and acks=1 loses acknowledged data when the leader fails before followers copy the record; replication factor 3 with min.insync.replicas=2 and acks=all tolerates one broker failure without losing acknowledged writes.
What to remember
In this answer, we saw that acks=0 waits for nothing, acks=1 waits for the leader, and acks=all waits for all in-sync replicas, while min.insync.replicas makes acks=all refuse writes when too few replicas are in sync. Since Kafka 3.0 the producer defaults to acks=all with idempotence. acks=0 and acks=1 can lose acknowledged data when a leader fails, and replication factor 3 with min.insync.replicas=2 and acks=all tolerates one broker failure without losing acknowledged writes.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
acks=0 sends without waiting for the broker, acks=1 waits for the partition leader to write the record, and acks=all waits until all in-sync replicas have it, while min.insync.replicas is a topic or broker setting that says how many in-sync replicas must exist for an acks=all write to be accepted. Since Kafka 3.0 the producer defaults are acks=all and enable.idempotence=true. acks=0 can lose anything and acks=1 loses acknowledged data when the leader fails before followers copy the record; replication factor 3 with min.insync.replicas=2 and acks=all tolerates one broker failure without losing acknowledged writes.
Why this question is asked
Every Kafka producer makes a trade-off between latency and durability, whether its author knows it or not. The settings are short, but the combinations behave very differently when a broker fails, and many data loss incidents come from a combination that looked safe. Interviewers ask this to check that we understand what an acknowledgement really promises. In this answer, we will recap leaders, followers and in-sync replicas, go through each acks setting, add min.insync.replicas, look at the defaults, and then replay a leader failure to see which combinations lose data.
1A Quick Recap of Replicas and the ISR
Each partition has a replication factor, for example 3, so three brokers hold a copy. One is the leader, which receives all writes; the others are followers, which fetch new records from the leader. A follower that is keeping up, by default one that has caught up within replica.lag.time.max.ms (30 seconds), is part of the in-sync replica set, or ISR. A follower that falls behind is removed from the ISR until it catches up.
If the leader fails, a new leader is chosen from the ISR, because those followers have all the records the old leader acknowledged with acks=all. Choosing an out-of-sync follower, called unclean leader election, can lose data, which is why it is disabled by default.
2The Three acks Settings
With acks=0, the producer sends the record and treats it as done without waiting for any response. It is the fastest and gives no guarantee: if the broker never received it, or crashed before writing it, the record is gone and the producer never knows. Retries do not help, because the producer never sees a failure.
With acks=1, the producer waits until the leader has written the record to its log. Followers copy it shortly afterwards, but the acknowledgement does not wait for them. With acks=all, also written acks=-1, the leader waits until every replica currently in the ISR has the record before it acknowledges. That is the setting where the acknowledgement means 'this record survives a broker failure'.
| acks | Producer waits for | Survives leader failure? |
|---|---|---|
| 0 | nothing | no, may never have been written |
| 1 | leader's own write | no, if followers had not copied it yet |
| all (-1) | all current ISR members | yes, if the ISR had at least 2 members |
min.insync.replicas controls.3Adding min.insync.replicas
There is a weakness in acks=all on its own. If two of the three replicas fall out of the ISR, the ISR contains only the leader, and acks=all then means 'the leader has it', which is no better than acks=1. min.insync.replicas closes this gap. It is set on the topic or as a broker default, and says that an acks=all write is accepted only if the ISR has at least that many members. If the ISR is smaller, the broker rejects the write with NotEnoughReplicasException instead of accepting it with weak durability.
The default for min.insync.replicas is 1, which leaves the gap open, so production topics usually set it to 2. Note that it affects only acks=all producers; acks=0 and acks=1 writes ignore it.
4The Defaults Changed in Kafka 3.0
Older producers defaulted to acks=1, so many systems were running with weaker durability than their owners believed. Since Kafka 3.0, the Java producer defaults to acks=all and enable.idempotence=true, which also means retries cannot create duplicates or reorder records within a partition. Idempotence is only enabled by default if no conflicting setting is given, for example acks=1 or a max.in.flight.requests.per.connection above 5, so an old configuration file can silently turn it off. Spring Boot does not override these defaults unless we set the spring.kafka.producer properties, so it is worth checking the effective producer config that the client logs at startup.
5Replaying a Leader Failure
Let us replay the scenario with replication factor 3. A producer using acks=1 sends a record. The leader, broker 1, writes it and acknowledges. Before followers 2 and 3 fetch it, broker 1 crashes. Broker 2 becomes leader without the record. The producer was told the write succeeded, yet the record no longer exists anywhere. When broker 1 restarts, it truncates its log to match the new leader, so the record is gone for good.
With acks=all and min.insync.replicas=2, the leader would not have acknowledged until at least one follower had the record. When broker 1 crashes, the new leader comes from the ISR and has the record, so nothing acknowledged is lost. If a second broker also fails, the ISR shrinks to one, below min.insync.replicas, and new writes are refused with NotEnoughReplicasException. That is unavailability for writes, but not loss: the system chooses to stop rather than to accept writes it might lose.
6 messages in order. Play them, or step through them one at a time.
With acks=all and min.insync.replicas=2, the ack would have waited for broker 2.
6Follow-up questions
Does acks=all make producing much slower?
It adds the time for followers to fetch and confirm, typically a few milliseconds within one data centre. With batching, throughput is usually close to acks=1, but per-record latency is higher. Across availability zones the extra latency is larger, which is the main reason some telemetry topics accept acks=1.
What if min.insync.replicas equals the replication factor?
Then a single broker failure, or even a slow follower, makes every acks=all write fail, so the topic becomes unavailable for writes during routine maintenance. That is why the common choice is replication factor 3 with min.insync.replicas 2: one failure tolerated without loss and without stopping writes.
7Conclusion
In this answer, we saw that acks=0 waits for nothing, acks=1 waits for the leader, and acks=all waits for all in-sync replicas, while min.insync.replicas makes acks=all refuse writes when too few replicas are in sync. Since Kafka 3.0 the producer defaults to acks=all with idempotence. acks=0 and acks=1 can lose acknowledged data when a leader fails, and replication factor 3 with min.insync.replicas=2 and acks=all tolerates one broker failure without losing acknowledged writes.
Open with
acks controls what the producer waits for. With acks=0 it does not wait at all, so it never learns about failures and anything can be lost. With acks=1 it waits for the partition leader to write the record to its own log, but not for followers.
Then, if they want more
With acks=all it waits until every replica in the in-sync replica set has the record. min.insync.replicas is a topic or broker setting that only affects acks=all: it says how many replicas must be in sync for the write to be accepted, and if the ISR is smaller, the broker rejects the write with NotEnoughReplicasException.
Its default is 1, which would let acks=all degrade to leader-only, so production topics usually use 2. Since Kafka 3.0 the Java producer defaults to acks=all and enable.idempotence=true, though conflicting settings such as acks=1 disable idempotence.
The combination that loses acknowledged data is acks=1, or acks=all with an ISR of one: the leader acknowledges, crashes before a follower copies the record, a follower becomes leader without it, and the old leader truncates when it comes back.
With replication factor 3, min.insync.replicas 2 and acks=all, any acknowledged record is on at least two brokers, so one broker can fail without loss, and if two fail, writes are refused rather than lost.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Kafka 3.0
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation, Spring for Apache Kafka reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Explain the producer settings acks=0, acks=1 and acks=all together with...": https://scrivio-interview-library.netlify.app/spring-boot/kafka/220b25ba8a/