Kafka Series - 2 Creating Kafka Consumer and Producer in Java Spring Boot Application

Consuming and publishing kafka messages in spring boot In the last blog we saw how to bring up a kafka cluster on local and publish-consume messages using kafka-console commands. In this blog we will take a look at how to connect your spring boot application to kafka cluster and publish-consume messages via it. Let’s start by creating producer first Go to https://start.spring.io/ Select Spring Web and Spring for Apache Kafka dependencies and generate the project Next open project in any of the code editor Now, we will have to create a kafka config, to do that create a PublisherConfig class...

September 30, 2023 · 3 min · 609 words · Bhushan Sonawane