Claiming to teach JDK 25 and Spring Boot 4 is a blatant clickbait tactic that prioritizes SEO over technical integrity. It is hard to trust architectural advice from someone who markets software that doesn't even exist yet.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Microservices Asynchronous Communication using Kafka | JDK 25 | Spring Boot 4 | By Mr. Kiran JadhavAdded:
Hello mates.
Welcome to full stack Java developer.
Today I will give the practical demonstration for microservices.
The asynchronous communication using Apache Kafka.
See mates, microservice means two or more spring boot modules that will communicate with each other.
And definitely for service to service communication we have two types available, synchronous and asynchronous.
For synchronous mostly we are using Feign client and asynchronous we are using here Apache Kafka.
Then today's session go I will give the practical hands-on for like spring boot with Apache Kafka using producer and consumer service. Then without dealing we'll start with our session here.
Then see, before jumping to practical we'll see some theory context.
See, here what is Apache Kafka? Apache Kafka it is a you can simply say distributed event streaming platform and it is designed for handling the real-time data feeds. And I'm giving here best example actually. You are using LinkedIn, Facebook, Instagram, WhatsApp. Those are also using Apache Kafka actually for messaging platform perspective. And definitely this is you can simply say high throughput, fault tolerance and scalable data streaming and messaging platform.
And mostly Apache Kafka we are using for event-driven architectures within microservices and log processing.
Then the key components of Apache Kafka we have producer, broker, topic, partitions, consumer and Zookeeper.
Then see mates, before going ahead with this theory context I want to give you one example here. Everyone they are using WhatsApp actually. Then you can simply say WhatsApp is a platform. It means this is the broker, this is the agent. Within WhatsApp we have available group actually. That group it means you can simply consider as a topic.
And the group have admin, he goes to publish the messages. The admin it means you can simply consider producer goes to publish the message. And within group we have available members. Those are the consumer you can simply say they are going to consume the message. Sometimes what happen, publisher goes to publish the message and consumer like they are going to read but sometimes some members they are they are off, they are going to receive this message later as well.
Right? Then this message never goes to lost because of partition, because message stored within partition itself actually. And we have available the Zookeeper like manage Kafka cluster method and configuration. It means you can simply consider producer goes to publish the like messages within topic.
The best example WhatsApp group admin goes to publish the message within WhatsApp group actually. Group it means topic.
Broker it means WhatsApp is a platform like Kafka server that stores and manage the messages.
And topic it means a category to which record are sent by producers and read by consumer. It means WhatsApp group you can simply consider. And partitions it means a topic is split into partitions to allow parallel processing as well.
And consumer it means those are the group member those are going to read the like you can simply say data from Kafka topic. And Zookeeper it means you can simply say manage Kafka clusters method and configurations. Then see where we are using Apache Kafka mostly. We are using for log aggregations like collecting logs from multiple sources. Even event-driven microservices it means asynchronous communication between multiple services as well.
Real-time analytics it means monitoring user activity on the websites, what they are trying to search it, right?
And accordingly you can simply give the feeds for those customers as well.
Messaging queue play replacement you can simply say previously we are using RabbitMQ, ActiveMQ. And definitely like instead of that you can simply use the Apache Kafka. Then what are the steps we need to follow for that perspective?
Those steps also I listed here and to all steps I am going to add within our YouTube video description box. And even code snippets also I am going to add on GitHub and this is the public repo available you can use freely.
Then see mates, first step we are going to follow download the Apache Kafka. How to download here?
Then this is the URL actually you can simply copy and come up with the first step here.
See, here we are going to download. Then I will prefer to use you can simply say version here. We have available different different versions as well, right? Yes. And definitely I am expecting here binary download Scala 2.13 version here. Simply click on that it will goes to download here.
See, it will goes to start download as well, right? Now we are just waiting to see like once it download then definitely we are going to show in folder. Right click there and go to the extract.
See, here same steps I given actually.
Okay?
See, extraction also done successfully.
The next step you can simply copy this Kafka folder and coming to our local disk C and in local disk C you can simply create the Kafka folder directory. See, in my local here is the Kafka folder I created.
And here you can simply paste this one.
Once it paste actually successfully you are able to see Kafka version 2.13, right? Here.
The next step see, I will open the PowerShell and move to Kafka folder. Then how we are going to move to Kafka folder? For that perspective you can simply goes to Windows button, press Windows button, open the PowerShell.
Then see mates, here is the PowerShell.
Okay? Now we are just trying to change directory here CD. Then you can simply go ahead with the like that particular window, right? Then definitely we are giving C. Then we have available Kafka there actually. And again there is available you can simply say Kafka 2.13 version. Now hit enter. I mean we are expecting this one only, okay? Yes.
And next step you can simply follow the JDK path but this is not at all mandatory in JDK 25.
Now you can simply go ahead and run the Zookeeper here.
The command to start the Zookeeper and Kafka then you can simply paste it here.
See, we are expecting Zookeeper goes to start now immediately like within minute. Yes.
Then see mates, next again you can open the PowerShell.
Here we are going to start the Kafka server as well. Again you can simply go to change directory C. We have available Kafka there.
Yes.
Now you can simply start the Kafka server as well.
Then see here is here is it we are going to start it.
See, it will goes to start. Then see, Zookeeper is working. Now Kafka is also working here. Then definitely both are working here. Then coming to next step, next step is you can simply goes to like KafkaTool.com and there we are going to download the offset explorer software there actually. Then see, coming to Chrome browser.
And here we have option available to download this. You can simply say offset explorer.
And definitely we are going to click on download. Once you click on download then definitely you are able to see the size here. I will download for 64-bit Windows operating system.
Then see, they given here actually like offset explorer, okay? You can simply here like Apache Kafka is a trademark of the Apache Software Foundation. Offset explorer is not produced by or affiliated with the Apache Software Foundation. It means this is a unique software we are using here actually for you can simply say see the messages as well, okay? Now it's also downloaded successfully. Then simply go ahead and start with the installation because here we have given you can download it and install it, right? Yes.
Then for that perspective we'll simply go ahead and show it in our download folder. Now once it available there we'll click on that and start with the installation. You know the very well installation process, right?
Just go with the next next and then finish.
Then see, it's taking at least minute to get go ahead with the installation part actually. Then definitely we need to wait.
>> [music] >> Yes.
Then see mates, now we are just going to click on next.
Then accept the terms and agreement here.
Goes to next.
Again you can simply goes to next here.
Again next.
And once it install successfully then you can simply open the offset explorer software actually there, okay?
Yes.
Then simply click on finish.
Then see, now we are going ahead and start with the offset explorer software here.
Now we are expecting like offset explorer goes to open my local and once it available yes, I I am just going to click on I agree. The previous progress we are able to see on screen here actually, right? Now here the next step we are going to create the cluster. See here is it. Like we are going to create the cluster there actually. Then this step we are going to follow. Right click here. Add new connection you can simply say.
And here we are giving the cluster name.
Then I want to give here you can simply say like uh you can simply consider any like a star, okay? I am giving here full stack HRM. Otherwise you can simply give whatever you want actually, okay? I am giving full stack HRM cluster here, okay?
See, this one we are expecting here. Now this is the like bootstrap server you are in. We are giving here localhost colon then we are giving 9092.
This is like URL we are going to pass here.
And cluster version you can select any but I will recommend 3.3 here. And you can click on ping as well. It's giving the response server is listening on this face platform, okay? But if you are passing different port it not goes to work, okay? Because this is already configured with Kafka and Zookeeper itself actually, right? Yes. Now simply click on here add. Then definitely like full stack HRM cluster also added successfully. See mates, here is it.
Now if you are coming inside that then definitely you are able to see there broker even there topic also you are able to see even consumers as well, right? Now we are just going to create the topic. See here is option available create topic. This is this next step we are going to follow. Then create the topic, okay? Yes.
Then see here I am going to create the topic. Either you can create here otherwise you have option available plus icon here. And then also you can create a topic here, okay? Perfect. Now I will right click here and create the topic.
And the topic name we are giving here full stack HRM topic.
This is the topic name I am giving here.
Then you can simply click on add here.
The definitely it giving issue contains one or more characters then ASCII, right? Yes.
Fine.
Then, what we need to do actually?
Uh you can simply come back to here again. Okay? Yes.
You cancel here. And now, uh we'll come up with here.
This one, right? Yes. This is you can simply say key content type and value content type available there actually, right? Yes.
Then now, we are just going to click on that and I'm giving here this is full stack.
You can simply say HRM topic.
Click on add.
Then definitely topic created successfully and for topic don't do the space as well.
See, our topic is created successfully.
If you're going to check here, see this is the topic we have created. And here, please select the string type here actually. Same type here else you can simply select the string itself and click on update. Once you click on update, now you can simply come with the partition.
And then partition, come up with the data. And here, we are going to run this, but before that you can simply say like we are going to like refresh it. If you're coming back, there is partition zero as well available, right? Yeah. If you're coming with the data here, then here you can simply click on plus icon and add a single message.
Then here, I'm giving the message. You can simply say like Hi.
Welcome to full stack Java developer Pune.
Welcome to full stack Java developer we are getting here Pune. Now, simply click on add. Then see, it added successfully here. If you want to add more, you can click on yes. I don't want to add more actually. I'm just going to click on no.
Then now, you can simply run it. The definitely here you are able to see KS hi and the value it means message welcome to full stack Java developer Pune. It means like our offset explorer also working as expected.
Perfect. Then see, those are the steps like we done with here actually, right?
Yes. The next is a very easy step because day-to-day you are working with the Spring Boot application. The definitely we're going to create the Spring Boot application for producer and consumer service. Hardly it will take only 5 to 10 minutes, not more than that as well. Then see, the next step we're going to start with, you know, the coding part. From that perspective, we'll come for the Spring Initializr here. And definitely I will type here Spring Initializr. Here we're going to create the Spring Boot project.
Then see, mates, this Spring Boot project we're going to create here.
Project as Maven, the language is Java.
Spring Boot latest version I'm using here. This is I'm giving the base package just come with the full stack.
The artifact it means our application name I'm giving here producer service.
Then see, refactor the base package like using a JAR, the configuration is XML file. Java 25 version I'm using here.
Like adding dependencies as per our business requirement, we'll use the double tool for live reload the application. Even we are using Lombok for production boiler plate code as well.
Even we require there like Spring Wave dependency as well. Like in-built Tomcat server, it will help us to create the REST APIs.
The next we are going to use here Swagger UI as well for open you can simply say proxy like you can simply say API documentation perspective even API testing as well.
And whatever dependencies you required like with the JPA, Java Mail API validations, you can add those actually.
Now, I'm going to add here Kafka dependency as well.
I will add here two dependencies for Kafka actually, Spring for Apache Kafka.
And one more I'm using here.
This one as well I'm trying to use here actually like Spring for Apache Kafka Streams as well, right? Like building stream processing application with Apache Kafka Streams.
Actually, the dependencies we have added. If you want to add more dependency, you can add those more dependency. Now, we have enough dependency here. Just click on generate.
Like within minute, production ready application will be available there. See on screen. Now, next application we are going to create here this is you can simply say consumer service.
That's why I'm creating here consumer service.
Then you can simply refactor the base package as well.
And again, simply click on generate.
See, mates, within minute, production ready application will be available there. Now, we have created two applications successfully here. The first one is you can simply say producer service and the second one is consumer service.
Now, I want to extract those applications as well. Simply go ahead and extract here.
Yes, this is extracted successfully, right? Now, what we'll do? Copy our application and paste into particular folder. I already created the folder name as application inside Kafka itself actually.
Next, we are going to copy this one as well. Whatever we have available there, right? Like you can simply say consumer service. In consumer service perspective, I need to extract it.
See, mates, we have [snorts] extracted successfully the consumer service as well.
And now, we are just going to copy it.
And you know, we are going to paste into our particular folder actually, right?
Yes. Here is it.
The next step, whatever producer service and consumer service we are going to import into our IntelliJ IDEA. Then come up with the IntelliJ here.
Goes to file.
New. Project from existing sources.
Then see, here I'm giving this is like producer service. Simply click on select.
Then create. I want to open with this window only. That's why it will open with this window itself actually, right?
Yes.
See here, open successfully.
Then you can simply build the project as well. Go to Maven. And here you have option available to clean space install.
So, it will start with the build as well, right? Yes. And even it's showing like you can simply enable those, you know, the conference and all. If you want, you can enable those as well, okay? But it's not at all mandatory now.
Now, coming to next. Next is you can simply consider that we have available there.
The next service is consumer service. We are going to import the consumer service as well.
Then here, I'm trying to like come up with the file. New. Project from existing sources.
And here I'm giving this is like consumer service. Simply select folder.
Go to create. I want to open with new window.
See, it will goes to open in another window.
Then consumer service also we'll do the build actually because this is the Maven project you can simply consider we are like pom.xml file available there, right? Yes.
Okay, we are expecting here consumer service, okay? Perfect.
It's not showing directly, right? Okay.
Go to new.
Project from existing sources.
I'm passing here this is the consumer service.
Select folder.
Click on select folder here actually.
It's taking time actually, right? Yes.
Click on create.
Okay, it's taking time. Then we have one more solution. Just stop this instance and goes to again file. New.
Project from existing sources.
And here I'm giving the path of our application for consumer service, okay?
Yeah.
You can simply select such a way actually here.
Goes to create.
Want to open with new window, not within this window, okay?
See.
>> [music] >> But I hope like I haven't given the proper path here. I need to give the proper path here. Yes.
Sometimes IntelliJ happens such a scenarios actually. Due to cache issue you can simply consider.
Click on create. I want to open with this window only.
Now, this is the correct service we're expecting, but it giving till issue.
We have one more solution for that actually if we're giving such issues there, okay? You not need to worry about that.
Fine. I will What I will do here actually? Come up with the IntelliJ. We have one more option available there.
Okay, you can simply click on plus icon here.
And from here I'm giving the path.
Simply select here. Select folder.
See, consumer service is added there now.
Okay, see here is the consumer service added. Like within single window, we'll open it actually, okay? Due to some cache issue, it giving the issue. I need to restart my IntelliJ because lots of projects available there. Anyway, you can use such approach, you will be able to run your application as well, okay?
Then see, the product producer service is work fine here. Then definitely I want to build the consumer service as well. That's why I'm coming back to here. Life cycle. We'll do the clean and then click on install.
Once clean build is success, then you can simply go to the install process here.
See.
Now, we are expecting install also goes to success. Then first we'll come up with the producer service. And here we are going to start with the implementation part, fine? Now, right click on com.fullstack package. Here I'm creating the new package. The package name I'm giving here model package.
Next package I'm creating here the package name as you can simply say this is service package.
And we'll create one more package.
Package name as controller as well.
In model package, I'm creating new Java class. You can simply say this is the employee because we have created the HRM application here, right? Yes.
And in controller, I'm creating new Java class. This is employee controller you can simply say.
One more controller I'm creating actually if you want, okay? Like application controller as well.
New Java class like hello kind of page API also we are going to create, okay? Application controller you can simply say here.
But you will be able to write with the employee controller as well, but that will be fine if you're using like application controller as well here, okay? Fine.
Then coming to service, where we are going to create new Java class as you can simply say producer service.
All right.
Then see, such a like class structure we have created here. Now, we'll start with the implementation. And see, mates, in employee I'm using at the rate data.
And this is you can simply say at all our constructor we are using at the rate no constructor. Now, I'm not using the JPA, that's why I'm not using entity annotation here.
I'm just going to mention private int EMP have ID. But it will be great if you are going to use private long EMP ID. And the So, you can simply use the wrapper class actually. Now, I'm using here private this is string EMP have name. And one more field I'm using private this is double EMP have salary thing. Perfect.
Then we are using number combinations.
We don't require the data set just manually to string manually as well. Now we'll come up with the next. Next is application controller. Uh here you can simply say like in employee controller also you can write the code. Otherwise, if you want to write in application controller, you can write here as well. I'm just giving here rest controller. And this is you can simply say request mapping and this is I want to say like API.
And definitely we are using here required a constructor as well.
Now I'm just going to call here private final. We have available producer service there, right? Yes, you can simply use this producer service here.
Perfect.
Then see mates. Like here we are just going to generate like allowable kind of activities. That's why I'm writing here.
You can simply consider at the rate post mapping and there we are going to say like send. Like publisher goes to like send the message actually, right?
This will be public. Response entity we are giving here and this is the message.
We are expecting like string type of message here and you can simply say this is the method like we are going to write here like uh send message or something if you want to say, right? Yes. Then I'm giving here send message. And definitely we are going to pass the message there.
I'm giving here this is the request body.
And we are considering this is the string type of message.
Okay. Now what we are trying to do, we are just going to call here producer service we got send message. Then you can call here producer service dot send message.
And there we are passing the message as the input parameter and we are returning here new response entity. And this is the message and corresponding HTTP status code we are giving here okay itself actually. Otherwise, you can give 201 it means created as well. You have freedom to pass like this status code as well, okay? Yes. Then here what I'm trying to do, I'm just giving like this is the response we are returning here, right? Then definitely you can simply say please check this message in consumer service log and even offset explorer as well. Please check message in consumer service logs and offset explorer. We have installed the software actually, right?
Yes. Then also you are able to see the message. Perfect. Control A and control L. Now what happened here? We need to like resolve the compilation problem.
Just move mouse over there, create method inside producer service. It will goes to create method here actually. Now come with the producer service. Here we are going to annotate with at the rate service annotation. And there is important as well. You can simply say one more annotation we are using here a required constructor as well, right?
Yes. We are using here this is annotation at the rate required constructor. Now I will do one thing, just maximize the size of screen.
That will be great to see. Right.
Then before going ahead, we require the Kafka topic and everything. Then definitely we'll come with the resources. We have available YAML file there. I will replace the YAML file with my existing YAML file here. See mates, this is the producer service YAML file we are going to add. We have we have added, you know, the Kafka producer.
Even we have given the bootstrap servers like this is the you can simply say URL with the port number. Serialization also we have passed the string and the JSON because I want to pass the employee type of object as well. And definitely port number we are expecting a 9191 for this like service as a consumer service. And the topic name I want to give the topic name whatever we have created here actually like full stack HRM topic I want to give there actually. You can simply give here full stack HRM topic.
Then see on screen here I'm giving full stack HRM topic.
If you want to give your unique, you can give your worries as well. You have freedom to pass here actually, right?
Yes.
See, I've given the same name because we are expecting that this message.
Then see mates.
Now again coming back to here at you can simply say producer service. I will maximize the size of screen as well here. Then first what we'll do, we are using at the rate value annotation and we are reading data from you can simply consider like we have available YAML file here actually, right? Then definitely we are going to read this data. For that perspective I'm using here dollar sign symbol. And there whatever like we are topic name we are trying to read, then this is you can simply say Kafka.topic.name.
This one we are expecting there, okay?
Kafka topic name. And I will write it manually. Like you can simply say Kafka.topic.name.
You need to give the proper space there actually. Without that it's never goes to work actually, fine? Yes.
The next we are using here this is private. You can simply consider final and we are going to pass here Kafka template. Itself available like send message method available there, send, right? Yes.
Then see, here it is.
Then whenever we are going to write the logic, right? Then definitely you can simply say Kafka template dot send. And definitely we are going to send here like the topic name.
Here we have available, right? But we haven't given directly. That's why I'm giving here private. This is string. You can simply say topic name.
And the same topic name we are passing here as well.
And the corresponding message we are passing here.
See, such a way we have done with the implementation at least for like hello API you can simply consider, fine?
But I want to add one more API there and this API I want to write in employee controller. For that perspective what I will do, I will use a rest controller here. At the rate request mapping as well and the base URL I'm passing here forward slash as employee.
Even I'm using here at the rate required constructor as well. If you want to just live for a year, you can use just live for a year as well. And again we are giving here this is private final like this is not the produce uh you can simply pass here producer service. Yes.
And definitely we are going to pass there this is post mapping actually like we are trying to, you know, send data, right? Then definitely like this is for employee we are trying to send the data like employee information you can simply consider here. I'm giving this is post mapping and the API name itself you can simply say send EMP info. You can write such API name. This will be public.
Response entity we are giving here.
And this is which type you want to like return the response, okay? Again, if you want to write a return string type of info response, you can return string type of response as well. You have freedom to pass it, fine? Yes. I want to say string itself actually and send you can simply say like employee info, okay?
Yes.
And here we are passing request body as well and this is the request body we are going to pass for employee itself.
See, this one I'm passing here.
And this is for employee. Now what we are trying to do, we have available the producer service dot you can simply say send EMP info. This is the method we are going to create there and in that we are passing employee.
And here return new response entity.
And definitely we are going to return here string type of message.
Please check employee details at consumer service log. Okay, this is the basic example. That's why I'm giving here.
And check also and please check in offset explorer as well and offset explorer also. Okay? We have given like this is the message we are trying to print there actually as a response, okay? And HTTP status code again I'm giving here okay itself.
Perfect. Now this method we need to create here in service layer. That's why again we'll come up with the like here you can simply mouse over there and create method inside service. Then see, method created inside service as well.
And here you can simply write like Kafka template dot send. Definitely here we are giving the you can simply say the topic name.
And we are passing corresponding employee info.
This is we are passing topic name and this is the employee we are passing here. Ending with semicolon. Control A and control L. This way like it will format the code base as well.
Such a way we have done with the producer service. Now next is we have available consumer service. Then definitely consumer service perspective we'll come back to here as a consumer service. Okay, here it is.
Then simply come with the SRC main Java or right click on com.fullstack new package. The package name as you can simply say this is service package I'm creating and at that service package we are going to create new Java class as consumer service.
See, class also created successfully.
Now come with the YAML file. Then YAML file uh like we are just going to add data from here the existing application actually. Yes.
And you know, consumer service is the part of 9191 port number and here uh our topic name you can simply consider whatever topic name we used the previous service actually there, right? Yes. See, here it is. We have available YAML file, correct? Yes. HRM like full stack HRM topic. Same I'm passing here as well.
See mates, here it is. I'm passing the same.
And now uh what we are trying to do actually, uh we'll simply come back to here in consumer service, okay? And consumer service we are going to our implement the logic. For that perspective I will maximize size of screen here.
Use at the rate you can simply say service annotation. At the rate required constructor as well. And definitely like we are going to implement the logic here now.
For that perspective like first we require here, you know, like create the method actually, okay?
The method is public void you can simply say listen. It means it will goes to listen these messages whatever we are going to read it actually, right? This will be like you can simply say consumer record we're using here and this is the like you can simply say uh consumer record itself.
And here we're trying to print it by using log.info.
You can simply print it, but we haven't used the SLF4J, that's why I'm using here at the rate SLF4J as well.
And now I'm using here like log.info, you can simply consider and in that we're going to pass like what message is received there actually, right? Then you can simply say message [clears throat] received from producer actually, right?
Yes. And definitely, this is consumer record.dot value you can simply pass here actually, okay? And definitely, once you're going to pass your consumer record.value, definitely we're able to read this data, but how?
For that perspective, we're going to say at the annotation KafkaListener. This is the interview question comes. Then see, mates, I'm using here KafkaListener and definitely here we're going to pass the topics.
Okay? And the topic whatever like topic we have added, this topic we need to mention here. Then see, the topic we're going to copy from here itself, like whatever we have available, right? This is the topic you can simply select.
Kafka topic you can simply say, this is the like we are giving their name, right? Yes.
Then here I will add like in double quotes you can simply say, okay? Yes.
Then first we're using dollar sign symbol, then you can simply use kafka.
topic.
name.
And the comma separated. Even we're going to pass a group ID as well.
See, this is the group ID we have given here, like you can simply consider here, right? Yes.
And definitely we need to mention this group ID as well here. For that perspective, what we're trying to do, again we'll come back to here.
Like whatever we pass from producer their group ID, right? Then definitely we're going to pass this one as well like Kafka consumer group ID here.
Yes.
This is for producer and this is for consumer actually. Then consumer perspective we require the Kafka consumer, you can simply say group ID.
Yes.
Then see, we're passing here group ID.
Again we need to pass here you can simply consider double quote.
Again we're passing here this dollar sign symbol and there you need to type like spring.kafka.consumer.uh hyphen group ID.
Spring.you can simply use kafka.
dot you can simply say we have available consumer.
Then you can simply use group-ID.
Like those you need to mention there actually, right? Yes.
Then see, here we're using Kafka like spring.kafka.consumer and this is the group ID we have mentioned. Such a way we have done with the implementation as well. Now we're very excited to start our application.
For that perspective, first we'll start with the producer service. Come up with the main class main method here. SRC main you can simply say java.com.fullstack, right? Yes.
And simply start this application.
Then definitely enable it.
Now I'll come back to here consumer service and simply start the consumer service as well. How we are saying this is the microservice? Microservice it means two or more spring boot module they will communicate with each other, right?
That's why like we're using here microservice this architecture and this is the asynchronous communication we're using here.
Then now what we're expecting? We're expecting coming back to here and hit here. This is localhost, the port number we're expecting 9191 /swagger-ui.html.
Like this is the producer service who goes to you know, like publish the message, right? Yes. First I will start with the basics actually. Like here I'm passing, you can simply consider, okay?
Yes, string type of message. I want to say like hey how are you?
And then I'm giving here welcome to full stack Java developer India's number one platform.
Now you can simply go ahead and execute the like here API. Then definitely we're expecting yes. Please check message in consumer service logs and offset explorer as well. We'll come back to like consumer service here.
Then definitely we have consumer service here and we receive the message hey, how are you? Welcome to full stack Java developer India's number one platform, right? This is what we're expecting.
And again if you are coming back to here and you can simply refresh it actually.
You have a refresh option available there, right? Yes.
See, here is it. You can come up with the data, just play it.
See, here is your message, right?
See, hey like welcome to full stack Java developer India's number one platform you are able to see on screen here actually, right? Yes.
This is what like we're expecting here actually. And one more we're expecting like you can again coming back to here and hit here for this employee information as well. Try it out. And you know the we're using Sagar right here actually, right? I'm passing 121 the employee name I'm passing here Sora Jadhav and definitely the salary we're passing here like 550,000.99.
Simply execute.
Again we're expecting this message please check employee details at consumer service log and offset explorer as well. Then we'll come up with the like you know, the consumer service log and definitely we're able to see the all the employee information like employee ID is 121, employee name is Sora Jadhav and the employee salary as well of 550,000. It means this is what like we're expecting it's working as expected and same we're expecting in offset explorer as well. Simply play it. Here you are able to see the employee information as well, right? See, this all information you are able to see on screen. Perfect.
Then see, mates, I want to explain this example here.
For that perspective, this session we have handled within like you can simply consider 25 minutes only, right? Yes.
Then see, we have available here producer service like who goes to publish the message. How? By using controller like we are just going to pass like you know, the request body as employee's information there.
Then we're calling here service, producer service and here itself we have available Kafka template actually. And what does it internally Kafka template?
It will help us to send the message, right? Publish the message you can simply say. How? By using you can simply say Kafka topic.
Then see, we're just calling here Kafka template.send and we're passing here Kafka Kafka topic name and the corresponding information as well. How we configure? If you are coming up with like again here animal file actually, right? Yes. See, here is the Kafka topic we have mentioned, full stack HRM Kafka topic, right? And here we have given you know, the producer bootstrap servers and key serializer and value serializer as well.
And now if you are coming up with the like consumer service, how we are reading the messages? For that perspective, you can simply say in properties animal file we have given there like spring.kafka.consumer with corresponding bootstrap servers URL key deserializer and value deserializer as well given and there is also available group ID and corresponding upper topic name also we have mentioned.
And in consumer service we use the KafkaListener, at the rate KafkaListener annotation to read those messages by using this topic and the group ID. And definitely we are able to print the messages within our consumer service as well. Then once this record available here, you can process your data and go ahead accordingly. Then see, mates, this is the first session like we have taken on you know, the Apache Kafka with like asynchronous communication by using this employee HRM application. In upcoming session definitely we'll go to deep dive into Apache Kafka. Then definitely if you want to like build your career in full stack Java developer and if you want to go to the like more learning curve, then definitely you can join us at our full stack Java developer platform where you will get the chance to learn and work with core Java, advanced Java, spring boot, data JPA, spring security Apache Kafka, Docker, Kubernetes, front end as React JS, database SQL and NoSQL both.
Like it include the spring as well. And mates, you will be ready for international certifications Oracle certified Java professional.
And those who want to like meet me, definitely my profile is also available on LinkedIn. You can simply like connect with me via LinkedIn as well. If you have any questions, you can definitely reach with me. I will give the solutions for that actually.
And see, mates, if you are like laid off from your current company, then definitely like finance, it means banking domain is very like demanding market. Even retail e-commerce also demand like products demanding market.
Then we have lots of products available here actually. You can simply like follow our YouTube for project based learning as well. And if you are from Pune, you can visit our Pune office.
You'll get lot of things here actually.
And the important thing I want to highlight here actually, our book also available at our Pune office. You can purchase this book, you will be able to crack your first interview. And this is book goes for full stack Java developer.
Whatever like TCS, Infosys, Wipro, L&T, Capgemini, Mastercard, like what not, including IBM as well. All asking the question from our book only. This book is available at our Pune office. You can visit at any time.
And definitely grab your copy today. And office address also I'm highlighting here actually. And if you want to like contact with our office number, this number also available here.
And mates, I don't want to create this topic more complex, okay? Whatever like notes I will add in YouTube video description box. Even code also I'm adding on GitHub. You can simply follow the same steps. If you are facing difficulties, add your comments in comment box as well. And I'm very happy to assist you here.
But again one more time giving this platform for working professionals, those who are working with like either support activities at development activities, but they want like go to deep dive into full stack advanced tech stack. Then definitely you can join us.
You will get 400% salary hike. If your current package is 4 to 5 LPA, you will get 20 to 25 LPA package as well.
Because you know, the full stack is very demanding market. Then definitely next turn for your career, you will get 400% salary hike as well and you'll be able to start your career with big MNCs.
Then mates, why you why you are waiting?
You can join us and start your career in full stack Java development. And then please for more updates, please do like, share, subscribe to get more updates and see you in next video. Thanks for watching you in next video. Thanks for watching this video.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











