advanced~3h

Kafka Streams: Real-Time Processing

Move beyond producing and consuming raw records into transforming, aggregating, and joining streams in place, using the Kafka Streams API's KStream and KTable abstractions.

Learning objectives

  • Beginner: Explain the difference between stream processing and batch processing, and why Kafka Streams runs inside your own application rather than as a separate cluster.
  • Beginner: Distinguish a KStream (an unbounded sequence of events) from a KTable (the latest value per key, materialized as a table).
  • Intermediate: Write a stateless topology that filters and transforms records using filter(), mapValues(), and branch-style splitting.
  • Intermediate: Write a stateful topology that aggregates a KStream into a KTable using groupByKey() and a windowed count or sum, backed by a local state store.
  • Advanced: Reason about windowing (tumbling vs. hopping) and when a windowed aggregation should flush results versus keep waiting for late data.
  • Advanced: Explain exactly-once processing in Kafka Streams and why it comes essentially for free compared to hand-rolling the same guarantee with a plain consumer and producer.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

Kafka Streams: Real-Time Processing

Next Step

Continue to Log Compaction →← Back to all Kafka & Microservices chapters