liveBook · Manning

Acks=0

As explained in Apache Kafka in Action

acks=0 is a Kafka producer setting that sends no broker acknowledgment to the producer and provides no guarantee that the message is persisted.

Suppose a temperature sensor sends a reading every millisecond. If only the current value matters, losing an occasional reading may be preferable to resending old data. Kafka’s producer setting `acks=0` fits that trade-off: the producer sends a message without waiting for a broker acknowledgment. It gets no confirmation that the message arrived or was persisted. section 5.1.1

With no acknowledgment to wait for, this strategy offers the highest performance of the ACK options described here, but the lowest reliability. It provides at-most-once delivery: a message may never arrive, while the producer does not resend it because an ACK was lost. The comparison to UDP describes the lack of delivery feedback; Kafka still uses TCP for transport. section 5.1.1 section 5.1.3

$ kafka-console-producer.sh \
    --topic products.prices.changelog \
    --bootstrap-server localhost:9092 \
    --producer-property acks=0

Set `--producer-property acks=0` on `kafka-console-producer.sh` to try this behavior with a topic. section 5.1.1

A send that appears trouble-free is not proof that a consumer can read the message. In a test where a topic required two in-sync replicas but only one remained, a message sent with `acks=0` did not initially appear in the consumer. Once the stopped brokers returned and caught up, it became readable. For important data, prefer an acknowledgment strategy that confirms persistence: `acks=1` confirms receipt by the leader, while `acks=all` waits for the in-sync replicas. section 5.1.2 section 5.1.1

How Apache Kafka in Action covers it

How deep it goes
Explains missing acknowledgments, persistence uncertainty, and at-most-once delivery, then tests behavior when too few replicas remain in sync.
Examples
Uses frequent temperature readings, a console-producer command, and a broker-outage test with a console consumer.
What you can do after
Operate/configure it with `kafka-console-producer.sh` and judge whether its performance benefit justifies unconfirmed delivery.
How it connects
Connects producer acknowledgments to at-most-once delivery, in-sync replicas, minimum in-sync replicas, and message persistence.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.