concept Kafka broker in category kafka

appears as: Kafka broker, Kafka broker, Kafka brokers, Kafka brokers
Kafka Streams in Action: Real-time apps and microservices with the Kafka Streams API

This is an excerpt from Manning's book Kafka Streams in Action: Real-time apps and microservices with the Kafka Streams API.

By default, Kafka is configured to autocreate topics, meaning that if you attempt to send to or read from a nonexistent topic, the Kafka broker will create one for you (using default configurations in the server.properties file). It’s rarely a good practice to rely on the broker to create topics, even in development, because the first produce/consume attempt will fail, as it takes time for the metadata about the topic’s existence to propagate. Be sure to always proactively to create your topics.

As you can see, the last assert line quickly verifies that your code is using the state store as expected. You’ve seen the ProcessorTopologyTestDriver in action, and you’ve seen how you can achieve end-to-end testing of a topology. The topologies you test can be very simple, with one processing node, or very complex, consisting of several sub-topologies. Even though you’re doing this testing without a Kafka broker, make no mistake: this is a full test of the topology that will exercise all parts, including serializing and deserializing records.

  • It’s useful to have at least one test using ProcessorTopologyTestDriver to test your topology from end to end. This type of test doesn’t use a Kafka broker, so it’s fast, and you can see end-to-end results.