Spring Boot with Kafka Producer & Consumer Example #kafka #springboot #java

preview_player
Показать описание
Learn how to integrate Spring Boot with Docker image of Kafka Streaming Platform.
Spring Boot provides ready made templates to implement Kafka Producer and Kafka Consumer applications that write and read data to and from Kafka topics. In this example we run the Kafka on Docker Container and try to invoke the producer with Spring REST API and write data to kafka topic and once the data or message arrived on kafka topic Kafka consumer will read the message by deserializing it from kafka topic and prints the message on console. You can see also how install / run kafka in docker.

Nowadays Spring Kafka combination getting more popular, since the many companies started building Event driven systems or microservices. Kafka very well fit into event sourcing architectures.
And also we can use Kafka as Event bus so that any producer application can publish messages to the kafka topics and any kafka consumer application can subscribe to particular topic and can consume messages. Spring provides kafka listener template to consume the messages from kafka topics in easy way.

▬▬▬▬▬▬ ⏰T I M E S T A M P S ⏰ ▬▬▬▬▬▬
0:00 - Introduction
0:11 - Intro to Spring Boot & Kafka
1:59 - Building Project with Spring Initializer
3:50 - Creating Kafka Producer
8:45 - Creating Kafka Consumer
12:05 - Creating docker compose file
15:20 - Testing with Postman client app.

▬▬▬▬▬▬▬▬ ✅ Spring Boot & Docker related Videos ✅ ▬▬▬▬▬▬▬▬▬▬

#springboot #kafka #docker #techtter

▬▬▬▬▬▬▬▬ ✅ Subscribe To Channel on Social Media ✅▬▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

🔥 Disclaimer/Policy:
The content of the videos, ideas given in videos all are self opinionated. The code samples shown in the video are collected from opensource projects shared on github and from other sources. The trademarks and logos shown on thumbnails and in videos are registered for respective companies. This video is not certified or accredited by them.
Рекомендации по теме
Комментарии
Автор

▬▬▬▬▬▬▬▬ ✅ Spring Boot & Docker related Videos ✅ ▬▬▬▬▬▬▬▬▬▬

Techtter
Автор

Hi, and thanks for this example! I have a question, if you could answer, in production, we use this type of Messaging, or we use things from Spring Cloud Stream, i mean annotating class with @EnableBinding and so on

gon
Автор

I have a question for this where are we creating the Topic or is the Kafka template automatically create the topic for us

niladrisekharnath
Автор

Hello! Thanks for your video. If you look at your application.yaml file, it contains bootstarp-servers: localhost:9092..
It should be bootstrap (and not bootstarp) - Spelling mistake over there.
Wondering how could the application found out the bootstrap servers?

santhoshs
Автор

thank you for this video it was eally helpful. i am working on a project where i receive some data from devices through Mosquitos Broker (using mqtt protocol), the mosquito broker send data to the consumer kafka and then the data are immediately stocked in MongoDB

My question is : what do think about this procedure, is it complexe ? if so what can you advice me to do as a best way ?

kaioid
Автор

Will this code work on normal windows 10 standalone?
Somehow the windows version doesn't allow Docker to be configured on my machine

rexsam
Автор

Careless instructors, how do you code without taking us thought how to install Kafka ?

kirwakelvinkering
Автор

Are you able to show your producer configuration print out? I am getting a 500 error from postman failed to construct producer.

JediMasterT