Kafka Acknowledgment Settings Explained: acks=0,1,all

Kafka Acknowledgment Settings Explained: acks=0,1,all

Kafka Acknowledgment Settings Explained: acks=0,1,all

Kafka’s acks configuration determines how the producer waits for acknowledgments from the Kafka cluster, impacting both performance and durability. Understanding how each setting behaves is essential for balancing throughput, latency, and data loss risk.

Let’s break down the three primary settings: acks=0, acks=1, and acks=all, along with their implications.

acks=0

Behavior

The producer does not wait for any acknowledgment from the broker. Messages are sent fire-and-forget.

Pros

  • Lowest latency
  • Highest throughput
  • Minimal overhead

Cons

  • No guarantee the message was received
  • Messages can be lost if the broker is unavailable or crashes

Best for

  • Low-value telemetry or metrics where occasional loss is acceptable

acks=1

Behavior

The leader broker acknowledges receipt after writing the message to its local log. Follower replicas do not need to confirm.

Pros

  • Good balance between performance and safety
  • Reasonable throughput and low latency

Cons

  • If the leader fails before replicas sync, messages may be lost
  • Not suitable for high-durability use cases

Best for

  • Stream processing pipelines where speed matters and occasional loss is tolerable

acks=all (or acks=-1)

Behavior

The producer waits until the leader broker has written the message and all in-sync replicas (ISRs) have acknowledged it.

Pros

  • Strongest delivery guarantee
  • Minimizes message loss

Cons

  • Higher latency
  • Lower throughput
  • Producer can block if ISR count drops

Best for

  • Financial transactions
  • Critical event logs
  • Systems requiring strong consistency

Choosing the Right acks Setting

This framework can help you determine the right acks setting for your use case:

  • Need maximum speed and can tolerate data loss? → acks=0
  • Want balance of speed and safety? → acks=1
  • Require guaranteed delivery? → acks=all

Also consider pairing acks=all with:

  • enable.idempotence=true to prevent duplicates
  • Monitoring for ISR shrinkage to detect potential risks

Kafka’s acks setting isn’t just a config—it’s a commitment to a durability model. Choosing the right level depends on your system’s tolerance for risk, latency requirements, and infrastructure reliability.

Need help tuning Kafka for your use case? Contact us to design a production-grade, loss-resilient Kafka pipeline.

24x7 Kafka Support & Consulting

24x7 Kafka Support & Consulting

24x7 Kafka Support & Consulting

Visit our Apache Kafka® page for more details on our support services.

Scroll to Top

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading