Kafka Producer Acks

Rob Golder
Lydtech Consulting
Published in
4 min readDec 18, 2021

--

Kafka Producers can be configured to determine how many replicas must acknowledge the write of a message to a topic partition before the message is considered successfully written.

It is important to understand the behaviour of this parameter and the trade-offs being made when configuring this setting, as it impacts durability and performance.

Acks Configuration

The Producer can be configured to wait for 0, 1, or all replicas to acknowledge a message write using the acks configuration parameter.

Configuring as 0 means the write is simply a fire and forget, as the Producer does not await any acknowledgement, and does not know whether the write succeeded or failed.

Configuring as 1 means that the Producer will await the one lead topic partition replica to acknowledge the write.

Configuring as all ensures that the Producer only receives acknowledgement of a successful message write once all the current in-sync replicas have received the message. The partition itself will only accept writes if there are at least the minimum required number of replicas in-sync, as configured by the min.insync.replicas setting. If there are insufficient replicas available then an error will be thrown, and the Producer can retry the write if configured to do so.

--

--