How to Build Event-driven Microservices with Spring Boot & Kafka

  Рет қаралды 20,761

Devtiro

Devtiro

Күн бұрын

Пікірлер: 51
@jelenatrifkovic5567
@jelenatrifkovic5567 5 күн бұрын
Such a good video for Kafka that provides not theory but code! I really needed this, thank you so much! Subscribed, hope you'll get more views and subscribers!
@BhaaRaThh
@BhaaRaThh Жыл бұрын
Your help to the community or people really great can say in words. I'm thankful for ever.
@devtiro
@devtiro Жыл бұрын
You are very welcome! 😁
@ripple123
@ripple123 Жыл бұрын
dude your videos are so clear, concise and you are very articulate! I would subscribe 1000 times if I could
@ahmdsaleem
@ahmdsaleem 11 ай бұрын
Great tutorial, devtiro! Your clear, detailed guide on building event-driven microservices with Spring Boot & Kafka is incredibly helpful. You make complex concepts easy to understand. Thanks for sharing your expertise-looking forward to more content like this!
@Vishal-8995
@Vishal-8995 Жыл бұрын
Same guy from the Kafka Basics Tutorial Video Forget everything I said, You're perfect as is.
@AnantaAkash.Podder
@AnantaAkash.Podder 10 ай бұрын
Devtiro Sir, your truly Underrated and should have many subscribers
@_ny385
@_ny385 Жыл бұрын
Great video, I've been looking for a spring boot x kafka rundown for a while now and this really ticks all the boxes. Thank you!
@zerocodercool
@zerocodercool 2 ай бұрын
You're the man! Thanks for sharing this. You earned a new subscriber!
@gangadevi3868
@gangadevi3868 Жыл бұрын
Awesome! Please continue the series.
@devtiro
@devtiro Жыл бұрын
Thank you so much 🙏I'll see what I can do!
@asterixcode
@asterixcode Жыл бұрын
Great video! Thanks for sharing this!!! The examples, content, approach and teaching process is amazing! Can't wait for more Kafka with Spring boot content... Maybe on how to test it with integation tests :)
@devtiro
@devtiro Жыл бұрын
Thank you! Great suggestion, I'll add it to the video backlog 💪
@adebowalegbenga4316
@adebowalegbenga4316 11 ай бұрын
Just few minutes into the Tutorial, I'm like this is what i have been looking for... The proof of concept is top-notch. But why not use Spring cloud stream?? Thanks so much!!
@marcinjozwiak8825
@marcinjozwiak8825 Жыл бұрын
Great content. I am waiting for more videos regarding software architecture and other approaches like CQRS :)
@devtiro
@devtiro Жыл бұрын
Thank you! I'll add CQRS to the video backlog 👍
@caffeinejavacode1475
@caffeinejavacode1475 Жыл бұрын
I thing it is Publish-Subscriber approach that you have shown. Event-driven approach is for instance (Event Notification approach) 1. book service got new book 2. then send message NEW_BOOK (not Entity) to TOPIC (NEW_BOOK is our Event that means: "Bro we got new book we have to notify all our friends") 3. book and author get messge NEW_BOOK and realise "Ok then we have to make REST call f.e and find last added book" microservices io said Use an event-driven, eventually consistent approach. Each service publishes an event whenever it update its data. Other service subscribe to events. When an event is received, a service updates its data. It looks you change state in subcriber services (book, author) according to Book entity then your explanation fits definition and it looks like Event Carried state transfer pattern (What do you think) (If I am mistaken let me know)
@devtiro
@devtiro Жыл бұрын
I'll do my best to give a good answer 💪 You're absolutely right that the mechanism we're using Kafka for could be described as publish-subscribe. We put something on the topic, but we don't care what picks it up, nor do we expect a response. I see this as an implementation detail of our approach to being event driven. The term "event driven" is pretty broad, it doesn't prescribe a particular implementation approach above emitting events and taking actions as a result (or not): martinfowler.com/articles/201701-event-driven.html. However, there are several patterns . The one shown in this video could fit under the "Event-Carried State Transfer" banner of the above article. But as always, what you build will depend on the requirements. Patterns exist as common solutions to common problems. I've this approach in 3 commercial projects so far and it worked wonderfully for distributing data in an eventually consistent way, but that's not to say it will work in all scenarios. The pattern you've identified as the Event Notification approach is totally viable and may be a better fit in some projects, especially when the data involved is too large to fit in a Kafka message e.g images or videos. However it also has the drawback of being synchronous in places -- requiring your REST services be up at all times, even under heavy load. That being said, these patterns along with the Actor pattern, Event-Sourcing and CQRS could all be described as Event-Driven and great solutions for different challenges 🙂
@youssefbouchara1179
@youssefbouchara1179 Жыл бұрын
Great content as usual! Keep it up :D
@devtiro
@devtiro Жыл бұрын
Thank you 😁 Lots more to come!
@BhaaRaThh
@BhaaRaThh Жыл бұрын
Really great. Thank you ☺️ sir.
@devtiro
@devtiro Жыл бұрын
Thank you for the kind words!
@farjallahhaythem5675
@farjallahhaythem5675 Жыл бұрын
soo greatt more content like this wow ur killing it bro
@devtiro
@devtiro Жыл бұрын
Thank you so much! 🙏
@ryokuuy
@ryokuuy Жыл бұрын
very well explained, can you maybe share about handling concurrent request and or async examples? thank you
@devtiro
@devtiro Жыл бұрын
Thank you! 🙏 I'll see what I can do!
@mrowox
@mrowox Жыл бұрын
Really nice tutorial. I am more interested in the Devops part of this though. How are you able to have more than one service in a single project. Is this a Monorepo kind of thing. How are you able to deploy the services separately. Is there specific spring configurations for this purpose. Thank you in advance
@NilushaDissanayaka-h5g
@NilushaDissanayaka-h5g 7 ай бұрын
great tutorial
@szymonpotorak9161
@szymonpotorak9161 2 ай бұрын
I understand the idea you presented in the video, but what about situations where you have to, for instance, query all the books with its authors. So the Book service will have to call Authors service for the details about authors, but it makes those services highly coupled that makes we should add an abstraction between them like a kafka topic to decouple them but when Book service calls the Author service via Kafka how the Author will know where to send data back?
@zshn
@zshn 8 ай бұрын
How will this exact scenario look like when deployed on AWS infrastructure? Would be great if you could cover it using AWS Lambda, RDS ,API Gateway and SNS.
@MuzaffarUmarjonov-v4l
@MuzaffarUmarjonov-v4l 8 ай бұрын
nice
@ravi1341975
@ravi1341975 Жыл бұрын
Great work ,looking forward more from you on these. Keep it up Bro, How can i acces the source code.
@ravi1341975
@ravi1341975 Жыл бұрын
oh sorry git hub link is there.
@devtiro
@devtiro Жыл бұрын
👍
@hkkabir2024
@hkkabir2024 7 ай бұрын
so for notification sending to frontend only kafka is enough? i can see u send the notification to that topic directly so if the frotnend will be the consumer for that notification so it will display on forntend right ??? plz let me clear
@gopishivakrishna9707
@gopishivakrishna9707 Жыл бұрын
Neat.
@UnaliverOfChildren
@UnaliverOfChildren 2 ай бұрын
SPRING CLOUD STREAMS
@YZ-ix3dn
@YZ-ix3dn Жыл бұрын
What about real-life scenarios, when the user want to see books list with author data? Looks like that for every book you are going to make HTTP GET from book-service request to author-service to get author by id. It's kind of bottleneck, what do you think?
@devtiro
@devtiro Жыл бұрын
As always, it depends 🙂 Microservices come with a premium: martinfowler.com/bliki/MicroservicePremium.html Therefore, typically the choice to use them is influenced by Conway's law e.g in order for multiple Dev teams to better work together. Or for horizontal scaling reasons. (This list isn't exhaustive, but should hopefully communicate the point I'm trying to make 😁) . In these scenarios the benefits likely outweigh the the increased latency of making multiple network calls. That being said, you can optimise on this by combining the data on an eventually consistent basis, which would reduce the network calls to 1 -- like a materialised view in a database. But, I'd suggest optimising only when necessary as premature optimisation has its own pitfalls. It all depends on the requirements. It's a big conversation, but hopefully this helps 🙂
@saharhoseini9282
@saharhoseini9282 Жыл бұрын
Thanks for the brief yet informative video, can I ask how we can debug this services in IntelliJ? I tried mapping the port 5005 for each service in docker-compose and made a remote-debug configuration, but when trying to start debug, I get address already in used :(
@devtiro
@devtiro Жыл бұрын
Thank you! Rather than use maven, in intelliJ I usually right click the main class in the file navigator and run it in debug from there. IntelliJ will handle connecting to the debug port for you.
@Cytronello
@Cytronello Жыл бұрын
Why are you using in your code in service layer interface service and impl of this interface? Proxy? I thought in new versions of spring there is no need for that
@devtiro
@devtiro Жыл бұрын
You can absolutely just use concrete classes and inject them where needed. There is a benefit to coding to interfaces instead of concrete classes though. Let's say you had a "FileSaver" interface that had an implementation that saves to disk and then you decided you wanted to save to the cloud. If you used the interface everywhere, you're simply creating a new implementation and then injecting that instead, rather than changing everywhere to use the new concrete class. It's not so much a Spring thing as a general OOP software thing. Nothing forces you to do it that way, but you soon learn to appreciate it 😁 Hopefully this helps!
@Cytronello
@Cytronello Жыл бұрын
@Devtiro Thank you for explanation
@cicciopasticcio8469
@cicciopasticcio8469 Жыл бұрын
Have you considered using Kafka Confluent, with avro schema?
@devtiro
@devtiro Жыл бұрын
A video using avro is a great idea, thanks! I'll add this to the video backlog!
@caffeinejavacode1475
@caffeinejavacode1475 Жыл бұрын
Is that good way to create domains module and use as one place where we have entity instead has entities in each module (service)
@devtiro
@devtiro Жыл бұрын
It depends 🙂 When anything is shared between microservices then it couples them to some extent. I fallback to Conway's law here. If there's a single Dev team working on the project, then the impact of coupling via a shared domain is lessened e.g a distributed monolith could be a viable solution (assuming you actually need it distributed). In the case of multiple Dev teams, I would suggest being less DRY* isn't all that bad, if you can deploy your microservices independently. *Don't Repeat Yourself
@zakviet
@zakviet Жыл бұрын
How you have created that beautiful architecture diagram.
@devtiro
@devtiro Жыл бұрын
Thanks! That one was done in Keynote 🙂
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 32 М.
The FASTEST way to PASS SNACKS! #shorts #mingweirocks
00:36
mingweirocks
Рет қаралды 16 МЛН
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 36 МЛН
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
Event-Driven Architecture (EDA) vs Request/Response (RR)
12:00
Confluent
Рет қаралды 139 М.
Event Driven Architecture EXPLAINED in 15 Minutes
14:55
Continuous Delivery
Рет қаралды 31 М.
A Beginner's Guide to Event-Driven Architecture
37:28
Software Developer Diaries
Рет қаралды 11 М.
Kafka Deep Dive w/ a Ex-Meta Staff Engineer
43:31
Hello Interview - SWE Interview Preparation
Рет қаралды 31 М.
Event Driven Programming with GO and Kafka
47:52
Akhil Sharma
Рет қаралды 10 М.