Spring Boot Application Events Explained with Real-Time Examples |

  Рет қаралды 18,725

Java Techie

Java Techie

Ай бұрын

#JavaTechie #DistributedMessaging #SpringBoot #ApachePulsar
👉 "n this video, we’ll explore Spring Boot's event-driven architecture, which offers modularity, asynchronous communication, and loose coupling. We'll explain event concepts, show real-time examples, and demonstrate running a Spring Boot application with custom event listeners.
What You Will Learn:
👉 What is Spring Events?
👉 Why we need Spring Events?
👉 Realtime usecase Hospital management system?
👉 Building Hands-On publisher & listener Examples using spring events
🧨 Hurry-up & Register today itself!🧨
Devops for Developers course (Live class ) 🔥🔥:
javatechie.ongraphy.com/cours...
COUPON CODE : NEW24
Spring boot microservice Premium course lunched with 70% off 🚀 🚀
COURSE LINK : Spring boot microservice course link :
javatechie.ongraphy.com/cours...
PROMO CODE : JAVATECHIE50
GitHub:
github.com/Java-Techie-jt/spr...
Blogs:
/ javatechie4u
Facebook:
/ javatechie
Join this channel to get access to perks:
kzfaq.infojoin
🔔 Guys, if you like this video, please do subscribe now and press the bell icon to not miss any update from Java Techie.
Disclaimer/Policy:
📄 Note: All uploaded content in this channel is mine and it's not copied from any community, you are free to use source code from the above-mentioned GitHub account.

Пікірлер: 70
@prasanthsanjeevi2563
@prasanthsanjeevi2563 Ай бұрын
Sir please do spring boot microservices real time project covering all patterns and tools please it's a request
@sushilbiswal1597
@sushilbiswal1597 Ай бұрын
Yes
@Javatechie
@Javatechie Ай бұрын
Hello Prashant, noted ✅️. I already have plans for this, but with my DevOps live course running, it's really difficult for me to manage time on weekends. I will definitely plan for it starting next month.
@prasanthsanjeevi2563
@prasanthsanjeevi2563 Ай бұрын
@@Javatechie even if it is paid also we are ready because we are eagerly waiting for your content
@gopikrishnacheekati1689
@gopikrishnacheekati1689 Ай бұрын
Yes
@Javatechie
@Javatechie Ай бұрын
No need to pay Prashant it will be completely free course I will do in youtube
@faixan13
@faixan13 Ай бұрын
Everytime I learned something unique and new from you regarding springboot. :) Will wait for exception handling part.
@tararamgoyal2220
@tararamgoyal2220 Ай бұрын
Thank you so much Basant for the exclusive content 🙏
@devolajide
@devolajide Ай бұрын
You are the only one that always give practical example to these concepts. Can you give tutorial on Domain Driven Design, Hexagonal Architecture and Spring Modulith?
@Javatechie
@Javatechie Ай бұрын
Yes I will thanks buddy 👍
@gopisambasivarao5282
@gopisambasivarao5282 Ай бұрын
Thanks Basant. Appreciate your efforts, God bless you. 🙂🙏
@MohitSaini-tv8go
@MohitSaini-tv8go Ай бұрын
Thanks Basant !! Awesome content !!
@psudhakarreddy6548
@psudhakarreddy6548 Ай бұрын
Thank you bro 😁😊. I am learning now things
@subhashsahu9930
@subhashsahu9930 Ай бұрын
By seeing your hardworking and deliver free contant is also motivates me to do some for society without any self interest. Hat's off sir....❤❤❤
@YashPatel-gp3gp
@YashPatel-gp3gp Ай бұрын
Hi Basant, I love watching your videos, Thanks for creating top notch content. Love the way you explain with examples. I would like to request you if you can a roadmap based on your video content, which would allow us to successfully land our dream java dev job.
@Javatechie
@Javatechie Ай бұрын
Thanks for your kind word surely I will prepare one 🙂
@ArshadMansuri-gb1so
@ArshadMansuri-gb1so Ай бұрын
Thank you so much Basant for providing useful & Awesome content, i have learnt many things from your videos and keep going on...please provide some more real time project videos .its a request.
@balag2368
@balag2368 Ай бұрын
Wonderful content bro.
@JikiJakaLu
@JikiJakaLu Ай бұрын
Thank you 🙏🏿
@arunpallayil9485
@arunpallayil9485 Ай бұрын
Spring Rocks! So do you @Javatechie, Thank you!. This is indeed a much better design rather than Autowiring a thousand services in a class. Very simple and right at the heart of SOLID. Great stuff. I am not sure of the idea of running it as @Async as the discharge process in this case is ONLY successful if ALL the downstream services are successful. Anything fails, the whole things fails. Unless and until we have a method to handle the failures, blocking approach is better. Anyway, Thanks again!
@Javatechie
@Javatechie Ай бұрын
Hello Arun , I do agree but same thing can be handle with async as well I will cover that error handling next
@arunpallayil9485
@arunpallayil9485 Ай бұрын
@@Javatechie Thank you. I just did a PoC myself. I used SpringRabbit (As my micro-services are using messages and not API calls. API calls gets terminated at Gateway and from there its messages.) Once the message is received, I am sending the message body to appropriate event class based on the message header. Then instead of writing massive long service methods, now I can write simple event handlers where each event is a small feature - such as SignInEvent, SignUpEvent, ForgotPasswordEvent - so easy to understand, so easy to test and maintain. Talking about testing, if you can cover the JUnit part of event testing that would be awesome too. This whole thing made my end to end architecture fully async as well. Earlier it was async only up to the method calls. So thanks again! Waiting for the next video to learn how are you handling the error handling. Cheers! ❤
@gajendrathakur4833
@gajendrathakur4833 Ай бұрын
Thank you Sir😊
@mareeskannanrajendran594
@mareeskannanrajendran594 Ай бұрын
Thank you for the content. Your content always helping me to learn new new things, keep on going. Could you please clarify me on handling exceptions while using Spring Events? Also how to capture the result of the execution in the publisher?
@rishiraj2548
@rishiraj2548 21 күн бұрын
thanks a lot
@manjindersingh5874
@manjindersingh5874 Ай бұрын
Thanks
@Javatechie
@Javatechie Ай бұрын
Thank you for your gift 🎁. Keep learning 😊
@satishmarutham3195
@satishmarutham3195 Ай бұрын
Thanks Basant.. When could be except the Second Part of Helm
@somethingforyou891
@somethingforyou891 Ай бұрын
If we have different methods in Notification or Other Handler classes, then how it takes excecute perticular method for the event. If I mention @EventListener @Async for other methods too.. Could you please explain it. Thanks for your way of explanation. Big fan of You ❤️
@sachinmukherjee29
@sachinmukherjee29 Ай бұрын
Thank you Basant for this awesome video. One question what if one of the services fails to process the event then how do we handle this scenario?
@Javatechie
@Javatechie Ай бұрын
I will cover this fault tolerance part
@immortalhuman7085
@immortalhuman7085 Ай бұрын
Hi you explained all void services. What if we want to retrurn from one service and consume the output in different service. Also What if any service in your example throw an exception? I know if exception thrown from thread will not hamper other threads all are running in thier own threads.
@sureshsadanala3605
@sureshsadanala3605 Ай бұрын
thank you Brother for sharing new concept :). I have one query here, Based on what order sprint events listener will execute. understood this is sync process but want to know how listener orders is preserved here
@Javatechie
@Javatechie Ай бұрын
Currently it will execute in async manner but you can maintain order of execution using @Order(count) in listerner Note : this is not recommended approach 😐. Because async means can't predict
@sureshsadanala3605
@sureshsadanala3605 Ай бұрын
@@Javatechie Basant For my business case, I need to execute in the sync manner, still can I use spring events ?
@krishrajan8670
@krishrajan8670 Ай бұрын
Good one One question, how to consume clean the room before go to billing for example
@Javatechie
@Javatechie Ай бұрын
We can set the order only if it is synchronous buddy, since it is async we cannot expect order
@deeplife9654
@deeplife9654 Ай бұрын
Hey bro , would you like to make a video on Jackson api , converting json file to java object and vice versa ?
@shwetharajesh424
@shwetharajesh424 Ай бұрын
How do we handle errors in this case? How to reprocess the failed events?suppose if house keeping service fails, how to handle it?
@Javatechie
@Javatechie Ай бұрын
I will cover that in next part
@shwetharajesh424
@shwetharajesh424 Ай бұрын
@@Javatechie Thanks
@esmaeeilenani2005
@esmaeeilenani2005 Ай бұрын
@@Javatechie you are the GOAT
@sairammanchala40
@sairammanchala40 Ай бұрын
Hi, can you please do a video on sending data with gzip requestBody with spring reactor Webclient.
@Javatechie
@Javatechie Ай бұрын
Yes I will
@ramrockzz8773
@ramrockzz8773 Ай бұрын
Hi Sir, Do you do 1:1 mentoring in which we can ask our doubts related to java spring boot microservices? It can be through chat
@sumantaghosh4239
@sumantaghosh4239 Ай бұрын
Thank you so much, but I have one question. In the case of distributed microservices, is this approach sustainable, or do we have to use message brokers?
@Javatechie
@Javatechie Ай бұрын
Yes ,This approach is only for within a application (intra application communication )
@akshaykumar-uv3up
@akshaykumar-uv3up Ай бұрын
How do we handle exceptions in kafka (both consumer and producer).
@manikantab7677
@manikantab7677 Ай бұрын
What if we need to maintain a order of execution of services consuming the event. How can that be handled.
@leovelcamiloneto3608
@leovelcamiloneto3608 Ай бұрын
In that case if service A need to be the first consuming event E and B second, all you need is to do is to make the service A publish another event E1 after consuming event E and then service B consume event E1. E -> A -> E1 -> B
@esmaeeilenani2005
@esmaeeilenani2005 Ай бұрын
what if we have a hierarchy of execution we need to maintain?
@RaviYadav-cx2pb
@RaviYadav-cx2pb Ай бұрын
Add database integration
@TheMrtest123
@TheMrtest123 21 күн бұрын
How to do the exception handling if there is issue with notification service?
@Javatechie
@Javatechie 21 күн бұрын
It's good to propagate the error from service to the caller
@TheMrtest123
@TheMrtest123 21 күн бұрын
@@Javatechie but let's say error is in notification service which is async. What is the best way to handle the error
@bala7965
@bala7965 Ай бұрын
Hi bro when will your devops course complete?
@Javatechie
@Javatechie Ай бұрын
Before 20 June
@malleswarrao3887
@malleswarrao3887 Ай бұрын
Hi Sir please plan for migration project sir
@djoleezcool
@djoleezcool Ай бұрын
As I understood they are to reusable in other services (spring-apps)? I don't see really use case where this will be better solution than just use async at top of async method.
@Javatechie
@Javatechie Ай бұрын
It will be very useful for monolithic architecture please try re visit the intro again
@sumitkarmakar9098
@sumitkarmakar9098 29 күн бұрын
@djoleezcool, there's a difference.. architecture wise EventListener approach is better. Here the parent method is not tight coupled. So, in future, if any child method is removed from the process or any new process needs to be added, no changes are required in the parent method. We just need to remove the Listener from the child method or add a new Listener.
@rabindradocument8934
@rabindradocument8934 Ай бұрын
We can do a direct method call also, why do we need events.
@Javatechie
@Javatechie Ай бұрын
Hello Rabindra, I explained it what's the drawback of durect method call
@rabindradocument8934
@rabindradocument8934 Ай бұрын
I understand. Tight coupling issue but with interface design we can make it loose coupling. Just like spring provides ApplicationEvent a abstraction we can have our own. We should have a custom annotation that will using executor service to make calls in async nature
@rabindradocument8934
@rabindradocument8934 Ай бұрын
I am asking this because our application doesn't use spring. It is a legacy one but we want above functionality
@Javatechie
@Javatechie Ай бұрын
I understand, but this is a feature of the Spring framework. If your app is legacy and not using Spring, you can go with the interface approach. This approach is not fully tightly coupled but only partially.
@anyiamoscar8832
@anyiamoscar8832 Ай бұрын
How do we handle errors.. With events
@importantmails7235
@importantmails7235 24 күн бұрын
why so bright ? i'd rather read the docs
Was ist im Eis versteckt? 🧊 Coole Winter-Gadgets von Amazon
00:37
SMOL German
Рет қаралды 38 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
Introduction to Spring AI | Spring Ai Framework
9:25
Daily Code Buffer
Рет қаралды 33 М.
Spring Tips: Spring's Application Event Subsystem
20:23
SpringDeveloper
Рет қаралды 13 М.
Event Driven Architecture - Understanding the Basics
14:49
Execute Automation
Рет қаралды 74 М.
SOLID Design Principles in java with Example | JavaTechie
34:44
Java Techie
Рет қаралды 179 М.
НЕ ПОКУПАЙ СМАРТФОН, ПОКА НЕ УЗНАЕШЬ ЭТО! Не ошибись с выбором…
15:23
Опыт использования Мини ПК от TECNO
1:00
Андронет
Рет қаралды 784 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 5 МЛН
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 6 МЛН
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 289 М.