12 Spring Kafka
This chapter covers
- Learning about Spring and when to use it with Kafka
- Understanding dependency injection
- Using Spring Kafka for building Kafka applications
- Building Kafka Streams applications with Spring
In this chapter, you will learn about using another open source library, Spring, to build Kafka and Kafka Streams applications. But before we get into that, let’s give some quick background on what Spring is and why you’ll use it. Spring originates as an IoC (inversion of control) container developed initially by Rod Johnson.
The inversion of control principle means that the main program or application does not control where its dependencies are coming from. If you are familiar with Spring, you can skip this introduction and go directly to the next section, where we use Spring Kafka to build a Kafka producer and consumer application.