...

/

Classic Integration: Project Setup

Classic Integration: Project Setup

Learn how to setup a Spring Boot application with classic Kafka Streams integration.

We will build a simple stateful Kafka Streams application, including a queryable state store accessible via a REST API, using Spring Boot.

Project setup

All Spring Boot projects have a similar structure. The easiest way to create a Spring Boot project is to use the official tool called spring initializr which allows us to conveniently choose our build tool, Java and Spring versions, and the required dependencies. We will start by choosing the various project details:

Press + to interact
Setting the project’s details using the spring initializr
Setting the project’s details using the spring initializr

Second, we will choose the dependencies required for a Spring Boot Kafka Streams application by clicking the “ADD DEPENDENCIES” button and typing Kafka Streams. We need the following dependencies:

  • Spring for Apache Kafka

  • Spring for Apache Kafka Streams

Press + to interact
Choosing the Kafka Streams dependencies
Choosing the Kafka Streams dependencies

Now we can click the “GENERATE” button at the bottom of the page, which will open up a download dialog for our zipped new project:

Press + to interact
GENERATE and EXPLORE buttons
GENERATE and EXPLORE buttons

The project can be unzipped to reveal the following structure:

A new Spring Boot Kafka Streams application
...