In the preceding section, we discussed two different modes of how services intercommunicate. These modes are nothing but styles of collaborations, which are as follows:
- request/response: In this, the client sends a request and waits for the response from the server. This is an implementation of synchronous communication. But it is not true that request/response is only an implementation of synchronous communication; we can use it for asynchronous communication as well.
Let's consider an example to understand the concept. In Chapter 2, Building Microservices, we developed ProductService. This service has the GetProduct method, which is synchronous. The client has to wait for a response whenever it calls this method: ...