Search⌘ K

Testing Kafka Streams Topologies

Explore how to validate Kafka Streams topologies through unit testing with the TopologyTestDriver. Learn to simulate input and output topics and verify processing logic automatically, improving development efficiency and reliability.

Every time we add or change the logic in our Kafka Streams topology, we should verify that our changes have the correct outcomes. This verification can be done by:

  1. Starting a Kafka cluster

  2. Running the entire application

  3. Publishing input messages using the producer CLI

  4. Reading the output message using the consumer CLI

While we should do this at least once or twice to verify all the parts of the system are playing correctly together, performing this for every change we make will become very cumbersome. If we want to automatically ensure that our ...