Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two spring boot apps communicating with messaging queue between each other

I have two spring boot apps running in the same local network and they need to communicate with each other. An obvious answer is to leverage REST API and make http calls, but I would like to use Spring Integration project for this purpose.

That said, I have several architectural questions regarding that:

  1. Should I setup a standalone messaging framework (e.g. Rabbit MQ) or embedded should also work (e.g. messaging will be embedded to one of the two apps).

  2. If standalone, what messaging framework should I choose: ActiveMQ, RabbitMQ or something else?

like image 843
Sergei Ledvanov Avatar asked May 18 '26 23:05

Sergei Ledvanov


1 Answers

Welcome to the Messaging Microservices world!

You go right way, but forget the embedded middleware if you are going to production. Especially when your application will be distributed geographically.

So, right you need some Message Broker and that should be definitely external one.

It's really your choice which one is better for your purpose. For example you can even take into account Apache Kafka or Redis.

If we talk here about Spring Integration it might be better for you to consider to use our new product - Spring Cloud Stream.

With that you just have your applications as Spring Boot Microservices which are able to connect to the external middleware transparently for the application. You just deal with message channels in the application!

like image 97
Artem Bilan Avatar answered May 20 '26 18:05

Artem Bilan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!