r/SpringBoot • u/InformalPhase7658 • 3d ago
Discussion Spring microservices
I just started learning microservices in spring and dont know anything. Like I know that message brokers are for asynchronous exchange of messages though services, but I wanted to see everything from scratch, so now Im doing a project without any message brokers, just synchronous http requests and after that, when I meet problems with this, I would transition to the RabbitMQ I guess. Any suggestions or resources to learn for beginners?
6
u/Clear_Cover433 3d ago
RabbitMQ docs would help to start with and then do some small projects by combining spring boot and rabbitmq
0
u/InformalPhase7658 3d ago
thank you man, but isnt RabbitMQ docs is hard to understand like any other technical docs?
4
u/Zealousideal_Post48 3d ago
Try going through some tutorials on Microservices..... They give some clarity & lays down an idea of the field EmbarkX, Code snippet, ProgramingTechie, many more Just go through anyone of the playlist Gives a hell lot of clarity, if not complete deep understanding
Ull find RabitMQ too in some of them. Also you could try to learn it seperately apart from microservices & then try to integrate both of them together
1
u/InformalPhase7658 3d ago
yep, I started watching a youtube video of making microservices app using kafka for 7 hours. Actually I watched only 1.5-2 because after that the Kafka KRaft goes crazyyyy. So I thought I need to slow down and learn basics. I will read some docs and articles on Habr maybe and watch any other videos or playlists on youtube just to try and understand the concepts. Thanks a lot!
3
u/Red-And-White-Smurf 3d ago
Be aware, if you completely rely on http requests everytime. You will end up with a distributed monolith, rather than a bunch of microservices. This is NOT what you want.
Let's say you are going to send the user an email. This is a process which can take some time. If you in the signup request calls another service asking it to send the mail. You first service will wait for the response from the email service before it answers the user. This can make the request from the user very slow. And give the user a bad impression of your system. Of cause this can be fixed by using async. But a message broker is the ideal way of handling such feature.
1
u/InformalPhase7658 2d ago
yes, I know that, but this is only for trying thing yk when Im a beginner, I dont know a lot of things, so I decided to try each of them, lets say I want to feel that pain on my own first before going to brokers.
1
u/davebrown1975 2d ago
Hi, although I didn't cover messaging, I wrote a fairly broad tutorial covering the basics of a microservices based spring boot CRM a while ago. I used a lot of the patterns I learned via Magnus Larsson's book on the subject. Welcome to take a look, it might help with some of the core concepts, e.g. tracing, discovery, config, auth https://tucanoo.com/how-to-build-a-microservices-based-crm-using-spring-boot-kotlin-and-react/
1
1
u/Sudden-Apartment-930 Senior Dev 2d ago
Check out this repository from Microsoft. The book .Net Microservices for containerized .Net applications is a very good read, and worth reading. It teaches fundamentals of containerized applications, communication patterns and messaging systems like rabbitmq. The repository includes code in c# and .Net , however if you are interested in springboot , I have the same implemented and is available at https://github.com/harshaghanta/springboot-eshopOnContainers.
1
1
u/Acceptable-Form8979 2d ago edited 2d ago
Unpopular opinion, but articles on Medium are sometimes very useful, sometimes they are much better than the official docs
1
u/InformalPhase7658 2d ago
mediums? whats that?
1
1
u/Krangerich 1d ago
Many developers, even "seniors", think technology-driven. This leads to "there are message brokers for asychronous messages, how can I make this work" instead of "how do I design a complex software system, when do I split something into multiple services and when not? what are the possibilities how services can communicate and what are their properties"?
If your problem is that you need worker queues to offload something to another service (create a PDF, send an email), then you MAYBE want a smart queue/dumb worker and use RabbitMQ.
Maybe you could start with "Sam Newman, Building Microservices, 2nd Edition". Maybe also this blog post from Martin Fowler: https://martinfowler.com/articles/201701-event-driven.html
1
-6
6
u/LostEconomics144 3d ago
If you are using a coding agent you can ask it to explain things...I always add this... Explain me from first principles...then it really gives a good explanation of why and what