KStream
KStream is a Kafka Streams abstraction representing an unbounded stream of key-value records processed as independent events.
Kafka Streams in Action, Second Edition
KStream is a Kafka Streams abstraction representing an unbounded stream of key-value records and supporting record-by-record processing operations.
- How it is used
- Builds Kafka topology paths that consume, transform, route, inspect, and publish key-value event records.
- How deep it goes
- Explains source creation, transformations, branching, terminal operations, and KTable contrast; defers lower-level Processor API control.
- Examples
- Uses masked retail purchases, branching coffee and electronics purchases, sensor streams, yelling text, and stock-ticker quotes.
- What you can do after
- Apply it via Kafka Streams DSL to construct chained topic-processing pipelines and inspect or route their records.
Read how Kafka Streams in Action, Second Edition explains KStream →
Apache Kafka in Action
A KStream is a Kafka Streams abstraction representing an unbounded stream of records, where each record is treated as an independent event.
- How it is used
- Uses KStreams to process topic records as events before joining current state or detecting patterns in incoming activity.
- How deep it goes
- Shows topic creation and worked grouping, aggregation, joins, and windowing; stops short of KStream implementation internals.
- Examples
- Demonstrates device-targeted notifications and one-minute counts of authentication attempts.
- What you can do after
- Build it from scratch with Kafka Streams to read topic events, aggregate by key, join state, and publish filtered results.
Kafka for Architects
KStream is the Kafka Streams abstraction representing a continuous stream of records and their transformations.
- How it is used
- Uses continuous Kafka event flows as inputs and outputs for transformations, filtering, mapping, and downstream processing.
- How deep it goes
- Defines the stream abstraction and DSL role, but stops short of low-level consumer, producer, offset, and partition management.
- Examples
- Demonstrates an order stream that filters totals, maps values, and writes processed records to another topic.
- What you can do after
- Apply Kafka Streams to declare a small event-processing topology without manually creating producers and consumers.
What to know first
- log compactionLog compaction is a storage technique that retains the latest record for each key while removing superseded records.
- data streamA data stream is an ordered sequence of data items that may be ongoing and is made available incrementally for consumption or processing.
Related concepts
- data streamkind of · A data stream is an ordered sequence of data items that may be ongoing and is made available incrementally for consumption or processing.
- KTablecontrasts with · KTable is a Kafka Streams abstraction representing the latest value associated with each key as a continuously updated table.
- Kafka Streamsused by · Kafka Streams is a client library for building applications that continuously process data from and write data to Apache Kafka topics.
- windowingused by · Windowing is the division of data or events into bounded subsets, often based on time or other constraints, for separate processing and result association.
- GlobalKTableused by · GlobalKTable is a Kafka Streams abstraction that replicates all records from an underlying topic to every application instance for read-only access.
- sink nodeused by · A sink node is a destination component or endpoint that receives data, messages, events, or flow from an upstream source for consumption or processing.
Questions about KStream
What is KStream?
KStream is a Kafka Streams abstraction representing an unbounded stream of key-value records processed as independent events.
Which Manning books explain KStream?
Kafka Streams in Action, Second Edition, Apache Kafka in Action and Kafka for Architects.
What should I know before learning KStream?
Manning books that teach KStream usually introduce log compaction and data stream first.
What is the difference between KStream and KTable?
KStream is a Kafka Streams abstraction representing an unbounded stream of key-value records processed as independent events. KTable is a Kafka Streams abstraction representing the latest value associated with each key as a continuously updated table.
What is KStream a kind of?
KStream is a kind of data stream. A data stream is an ordered sequence of data items that may be ongoing and is made available incrementally for consumption or processing.
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.


