liveBook · Manning

Pipeline

As explained in Kafka Streams in Action, Second Edition

Pipelining is a processing pattern that overlaps record retrieval and record processing so the consumer can continue retrieving batches while earlier batches are handled.

Pipelining overlaps Kafka record retrieval and processing: the consumer hands one batch to asynchronous work, then returns to poll for the next batch. section 4.3.5

A reliable pipeline separates three responsibilities:

  • Consume a batch and hand it to a record processor that returns immediately. section 4.3.5
  • Process records concurrently while tracking which records have fully completed. section 4.3.5
  • Commit only completed offsets, using the next offset after the last processed record in each partition. section 4.3.5

Consumer loop

Poll records, call recordProcessor.processRecords(consumerRecords), obtain recordProcessor.getOffsets(), and call consumer.commitSync(offsetsAndMetadata) only when completed offsets are available. The processor groups records by TopicPartition, processes each record, stores lastOffset + 1, and offers the offset map for commitment.

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains the consumer loop, partition offset calculation, and commit timing, while omitting the complete processor implementation.
Examples
Uses Java consumer and processor listings that poll batches, process partition records, queue offsets, and commit synchronously.
What it assumes
Assumes Kafka consumer polling and offsets, while clarifying that committed positions identify the next record to retrieve.
What you can do after
Implement pipelined Kafka consumption with manual commits that acknowledge only successfully processed records.
How it connects
Connects asynchronous processing with Kafka consumers, partitions, polling, offset commits, and auto-commit risks.

Also explained in

Compare how 48 books explain pipeline →

Related concepts

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