Monedula

Kafka producer config

Kafka acks: 0 vs 1 vs all

Producer config · default all · Apache Kafka 4.3

acks sets how many replicas must have a record before the Kafka producer counts the send as successful. acks=0 waits for nothing, acks=1 waits for the partition leader only, and acks=all (the default since Kafka 3.0) waits for every replica in the ISR. Only acks=all, with min.insync.replicas of 2 or more, survives losing the leader without losing acknowledged records.

Config
acks (producer)
Default
all
Valid values
0, 1, all (-1 means the same as all)
Reference
Apache Kafka documentation for acks
acks=all produce blocked - NotEnoughReplicas. Durability wins: acks=all refuses to ack below min.insync.replicas. Open this step in the full playground

Values

What it does

A produce request goes to the partition leader, and followers copy the record by fetching from it. acks decides at which point of that process the leader answers the producer. With acks=all the answer comes when the record is below the high watermark, which also means consumers can read it. Idempotence requires acks=all, so setting acks to 0 or 1 turns idempotence off unless it was enabled explicitly, in which case the producer fails with a ConfigException.

The trade-off

Each step up costs latency: acks=1 adds the leader write, acks=all adds a follower fetch round. In return, acks=all with min.insync.replicas=2 guarantees that an acknowledged record exists on at least two brokers. The catch is availability: when the ISR shrinks below min.insync.replicas, acks=all producers are refused while acks=1 producers keep writing, with only the leader holding their records.

Advice

See it in the simulator

Related configs

All Kafka configs