As preferred communication between microservices is RESTish protocol which is same as URL based communication on top of HTTP . As docker containers also runs in a network based environment, so is it like each container has to know how to process http request, response to communicate with other containers? If my container have java application running should I have to implement JAX-RS(Java API for RESTful Web Services) to make my container understand HTTP request,response. And if my other container running node.js, it has to implement REST api for node.js
Asked
Active
Viewed 1,475 times
0
-
I'm confused as to what your asking. Are you talking about containers talking to each other on the same machine? – tier1 Jun 14 '16 at 12:50
-
If I have two microservices implemented using Docker and they want to transfer information between the services does we have to do as above i.e. using the REST api of the programming language used to develop the services and have them talking by http request and response. – Tinkaal Gogoi Jun 14 '16 at 16:51
-
1They can talk to each other using the REST api that you've developed, but your going to have to link the containers together to allow network access between them. You can see an example of that here: https://rominirani.com/docker-tutorial-series-part-8-linking-containers-69a4e5bf50fb#.tlhpqnqtm – tier1 Jun 14 '16 at 17:15
-
1If you use synchronous communication between two microservices it introduces dependency and coupling such that if one of the services is unavailable the other would fail... consider using messaging for communication between your microservices. – Sean Farmar Jun 21 '16 at 12:05
-
Possible duplicate of [How to let different Docker containers talk to each other without exposing the ports to the whole world](https://stackoverflow.com/questions/35194761/how-to-let-different-docker-containers-talk-to-each-other-without-exposing-the-p) – Paul Sweatte Jun 09 '17 at 04:21