I have 2 spring boot applications and I need to communicate between these two applications. I have rest template to communicate. Any other techniques to communicate other than rest template?
3 Answers
There are some patterns are being used in microservice architecture:
- https://medium.com/@diogo.lucas/communication-patterns-in-a-microservice-world-af07192b12d3
- http://microservices.io/patterns/communication-style/messaging.html
- https://learn.microsoft.com/en-us/dotnet/standard/microservices-architecture/architect-microservice-container-applications/communication-in-microservice-architecture

- 886
- 1
- 10
- 20
This question has nothing to do with Springboot per se. Question here is how should two applications(web or non web) communicate with each other.
With respect to communication, it's again depends on the requirement, whether you need Synchronous communication or Asynchronous communication.
If its Synchronous communication(where you wait for the result, and client is blocked), you use Rest Template
If its Asynchronous communication(where you don't want to wait for result and client is not blocked), you use Message Brokers like ActiveMq, Kafka etc....

- 25,582
- 8
- 87
- 134
-
Thanks @pvpkiran, For Sync, is there any tech available other than rest template ? – Rajasekar Sambandam Jan 31 '18 at 10:39
-
This is a helpful answer, can you write in details about the 2 types of communication? I upvoted your answer but others might appreciate more than. – Arefe Feb 16 '19 at 18:30
If you are using Spring in your application you might wanna try Spring Integration. Spring Integration
is a spring module that helps integrating two systems together.
Spring Integration extends the Spring programming model to support the well-known Enterprise Integration Patterns. Spring Integration enables lightweight messaging within Spring-based applications and supports integration with external systems via declarative adapters.
You also have Apache camel
at your disposal.
Check out more details here.
Apache Camel is an open source Java framework that focuses on making integration easier and more accessible to developers. It does this by providing:
- concrete implementations of all the widely used Enterprise Integration Patterns (EIPs)
- connectivity to a great variety of transports and APIs
- easy to use Domain Specific Languages (DSLs) to wire EIPs and transports together

- 1
- 1

- 12,010
- 6
- 65
- 78