liveBook · Manning

Kafka transaction

A Kafka transaction is an atomic operation that groups record production and related offset commits so their effects are committed together or aborted.

How 3 Manning books explain it

Kafka Streams in Action, Second Edition

A Kafka transaction is an atomic unit that groups record production and related offset commits so they either all succeed or all abort.

How it is used
Ensures exactly-once processing when producing records, especially across partitions or during consume-transform-produce flows.
How deep it goes
Walks through producer initialization, transaction control, consumer isolation, last stable offsets, and transactional offset commits, while deferring transaction design internals.
Examples
Uses a financial duplicate-prevention scenario and a stock compliance-reporting consume-transform-produce application with TopicPartition offsets.
What you can do after
Build it from scratch with KafkaProducer transaction calls, read_committed consumers, and sendOffsetsToTransaction() for atomic processing.

Read how Kafka Streams in Action, Second Edition explains Kafka transaction →

Apache Kafka in Action

A Kafka transaction is an atomic operation that groups message writes and related offset commits so they either all succeed or all roll back.

How it is used
Supports consistent Kafka-to-Kafka processing by grouping output writes and consumer offsets atomically.
How deep it goes
Explains the producer lifecycle, transaction coordinator, commit and abort markers, and consumer visibility.
Examples
Demonstrates an account transfer with a Python producer and compares database offset storage with idempotent writes.
What you can do after
Apply it via confluent-kafka to commit multiple writes atomically, and configure consumers to read only committed messages.

Read how Apache Kafka in Action explains Kafka transaction →

Kafka for Architects

A Kafka transaction is an atomic operation that groups record production and related offset handling so their effects can be committed or aborted together.

How it is used
Coordinates read-process-write pipelines whose outputs must remain consistent across retries, failures, and multiple Kafka topics.
How deep it goes
Defines the Kafka-specific exactly-once model and consumer isolation, without providing a low-level implementation walkthrough.
Examples
Uses an OrderService that reads ORDERS and writes SHIPMENTS, BILLING, and INVENTORY atomically.
What you can do after
Apply Kafka transactions to read-process-write workflows requiring exactly-once results across multiple output topics.

Read how Kafka for Architects explains Kafka transaction →

What to know first

Related concepts

Questions about Kafka transaction

What is Kafka transaction?

A Kafka transaction is an atomic operation that groups record production and related offset commits so their effects are committed together or aborted.

Which Manning books explain Kafka transaction?

Kafka Streams in Action, Second Edition, Apache Kafka in Action and Kafka for Architects.

What should I know before learning Kafka transaction?

Manning books that teach Kafka transaction usually introduce topic, client, Kafka producer and offset first.

What are the parts of Kafka transaction?

Kafka transaction includes isolation and atomicity.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.