Chapter 6: Communication Pitfalls and Prevention
- In synchronous communication, the client sends a request and waits for a response from the service. Synchronous communication can be blocking or non-blocking, but the client can only continue further processing once the response is received from the service. In asynchronous communication, the client sends a message to the message broker that acts as middleware between the client and service. Once a message is published to the message broker, the client will continue processing without waiting for the response. The service can subscribe for specific messages to the message broker and place responses back in the message broker after processing. Both the client and service are unaware of each other and can continue to evolve without any dependency.
- Direct client-to-microservice communication introduces tight coupling between the client and microservice, where clients need to be aware of how different microservices...