chapter twelve

12 Spring Kafka

 

This chapter covers

  • Learning about Spring and why you’ll use it with Kafka
  • Discovering what is 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, 11.1, where we use Spring Kafka to build a Kafka producer and consumer application.

12.1 Using Spring to build Kafka-enabled applications

12.1.1 Spring Kafka application components

12.1.2 Enhanced application requirements

12.2 Spring Kafka Streams

12.3 Summary