Search⌘ K
AI Features

Spring Cloud Stream: Topology and State Store

Explore how to build Kafka Streams topologies using Spring Cloud Stream's functional interfaces. Understand defining Consumers and Functions, managing topic bindings via properties, and querying state stores with InteractiveQueryService in Spring Boot applications.

Topology

In order to create a Kafka Streams topology using Spring Cloud Stream, we need to understand three concepts:

  • Functional interfaces

  • Topology definition using functional interfaces

  • Topic binding

Spring Cloud Stream functional interfaces

In Spring Cloud Stream, the Kafka Streams topology is defined using a functional interface. This means that we define a bean with a return value that is either a Consumer<KStream<K,V> if our topology is only consuming Kafka messages, or a Function<KStream<K,V>,KSt ...