Asynchronous microservice communication
Sync is like having a direct conversation, but async is more like leaving a message. Microservices don’t wait for a reply, they just send the information and move on.
In asynchronous communication, the requesting service sends a message to the receiving service without waiting for an immediate response. The response is delivered later, either through a callback or through a separate channel.
Figure 2.6: Asynchronous microservice communication
Here’s a breakdown of the steps:
- Send a message: The calling microservice sends a message with the information to another microservice.
- Move on: The calling microservice doesn’t wait for a reply. It continues its own task.
- Process later: The other microservice receives the message and works on it whenever it’s free.
- Reply: The other microservice might send a response back later, but that’s not required.
Think of...