liveBook · Manning

At-most-once delivery

As explained in Apache Kafka in Action

At-most-once delivery is a message delivery guarantee that permits message loss but prohibits duplicate delivery.

At-most-once delivery guarantees that a message is delivered no more than once, so duplicates cannot occur, but the message may never arrive. In Kafka, producers obtain this guarantee with acks=0: they do not wait for broker acknowledgment. section 5.1.3

When losing a reading is preferable to duplicating it

A temperature sensor sending continuous readings in very large quantities may use acks=0 when a missing measurement is acceptable but a duplicate reading is undesirable. The same trade-off would be unsafe for banking transactions, where duplicate credits or debits could occur under other delivery settings. section 5.1.3

The configuration trades reliability for simplicity and speed:

  • Set acks=0 to avoid waiting for acknowledgments and accept that a broker may never receive the message. section 5.1.3 section 5.4
  • Choose at-most-once when duplicate suppression matters more than recovering every measurement. section 5.1.3
  • Use at-least-once or exactly-once alternatives when message loss or duplicate processing is unacceptable. section 5.1.3 section 5.4
Figure 5.2 We get at-most-once delivery guarantees with acks=0.
A black background with a red x

AI-generated content may be incorrect.

Visualizes how acks=0 produces at-most-once delivery by removing the producer’s acknowledgment wait. section 5.1.3

How Apache Kafka in Action covers it

How deep it goes
Defines the guarantee, explains its acknowledgment mechanism, and contrasts its loss trade-off with other delivery guarantees.
Examples
Uses continuous temperature readings as an acceptable-loss case and banking transactions as a duplicate-sensitive contrast.
What it assumes
Assumes basic Kafka producer and acknowledgment concepts while defining the three delivery guarantees directly.
What you can do after
Operate/configure Kafka producers with acks=0 when avoiding duplicates outweighs guaranteed message arrival.
How it connects
Connects Kafka producer acknowledgments with at-least-once delivery, exactly-once semantics, idempotence, and message loss.

Also explained in

Compare how 5 books explain at-most-once delivery →

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.