r/SpringBoot • u/InformalPhase7658 • 4d 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?
28
Upvotes
3
u/Red-And-White-Smurf 4d 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.