liveBook · Manning

Transaction coordinator

As explained in Apache Kafka in Action

A transaction coordinator is the Kafka broker component that coordinates a transaction and writes markers recording its commit or abort outcome.

A transaction coordinator is the Kafka broker component that manages a transaction across partitions. Producers register target partitions, write tentative messages, and then report completion. The coordinator records the outcome with commit markers or abort markers, preserving all-or-nothing behavior even when brokers or producers crash. section 5.2.3

Flight and hotel reservation

A flight-and-hotel booking illustrates the flow: reserve the hotel with cancellation available, book the flight, then confirm the hotel only after the flight succeeds. Kafka similarly holds messages as tentative until the coordinator commits them; an abort marker causes consumers to skip them. section 5.2.3

A read_committed consumer does not need to understand transaction state. The broker holds messages after an unfinished transaction to preserve ordering, releases them after a commit marker, and skips aborted messages while continuing with unrelated records when permitted. section 5.2.3

Figure 5.7 Our consumer stops receiving new messages as soon as a transaction remains unfinished because the broker only sends messages up to the start of the unfinished transaction and holds back all subsequent messages, even those unrelated to the transaction. The ordering guarantee still holds. When a transaction-commit is received, all messages are released and sent to our consumer. If a transaction is aborted, our consumer doesn’t receive messages belonging to the aborted transaction, but messages not belonging to the transaction are still received normally.
A group of buttons with numbers and symbols

AI-generated content may be incorrect.

Follow the message flow through unfinished, committed, and aborted transactions to see when the broker releases, delays, or skips records. section 5.2.3

How Apache Kafka in Action covers it

How deep it goes
Explains partition registration, tentative writes, outcome markers, crash guarantees, and broker-side read_committed filtering.
Examples
Uses a flight-and-hotel reservation analogy and a message-flow figure covering unfinished, committed, and aborted transactions.
What it assumes
Assumes familiarity with Kafka partitions and consumers while explaining transaction visibility through concrete booking and message-flow examples.
What you can do after
Evaluate transaction reliability and understand how Kafka consumers receive only committed records.
How it connects
Connects transactions with idempotent producers, two-phase commit, partitions, and read_committed consumers.

Also explained in

Compare how 2 books explain transaction coordinator →

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.