Message brokers
In a direct communication model, microservices would have to be aware of each other’s locations and availabilities. This creates a tightly coupled system that’s difficult to maintain and update.
By introducing a message broker, microservices become loosely coupled. They simply send messages to the broker, which handles the routing and delivery. This allows microservices to operate independently without needing to know the specifics of other services.
With message brokers, communication becomes asynchronous. A producer (microservice) can send a message without waiting for a response from the consumer (another microservice). This improves performance and scalability as microservices don’t have to wait on each other.
Figure 2.8: Message brokers
Message brokers use different message storage models. The most popular ones are Message Queues (MQs) and Topic. Message brokers store messages in an MQ until they are received...