0Pricing
Advanced Spring Boot 4: Event-Driven Architecture (Kafka) · Lesson

Windowing and Stateful Aggregations in Kafka Streams

Learn to perform time-windowed aggregations and manage state stores in Kafka Streams to compute running counts, sums, and metrics over event streams.

Stateful vs Stateless

Operations like map and filter are stateless. Aggregations such as counting or summing require state that persists across records.

Kafka Streams manages this state for you in local state stores.

Grouping a Stream

Before aggregating you group records by key with groupByKey or groupBy.

KGroupedStream<String, Order> grouped =
    orders.groupBy((key, order) -> order.getCustomerId());

All lessons in this course

  1. Introduction to Kafka Streams
  2. Stream Processing with KStream & KTable
  3. Building a Simple Stream Application
  4. Windowing and Stateful Aggregations in Kafka Streams
← Back to Advanced Spring Boot 4: Event-Driven Architecture (Kafka)