Setting Up the Project
Learn how to add the Kafka Streams dependency, set up the minimal configuration required for the Kafka Streams application, and build a topology with a source processor.
Every vanilla Kafka Streams application, which is built without the help of third-party frameworks like Spring Boot, has the same structure. It has the Kafka Streams dependency; it defines the topology and the configuration properties and starts the topology.
In this lesson, we will work on the setup required before we can actually run our Kafka Streams application. The project skeleton with the files contains the following:
build.gradle
: The gradle build file where we will define the dependency for Kafka Streams.MusicToFeelingsAppication
: The main class, where we will define the configuration properties and run the topology.FeelingsTopology
: The class where we will define the topology.
Each file contains some of the required code but not all of it. We’ll fill in the gaps together. Let’s run the project by clicking the “Run” button. This will start the Kafka server, create the input topic, and set gradle to watch for changes in the file.
Get hands-on with 1200+ tech skills courses.