Following are few use cases where this pattern will be a right fit:
- Reduced coupling: The message broker decouples the senders and the receivers. The senders and receivers communicate only with the message broker.
- Improved integrability: The services that communicate with the message broker do not need to have the same interface. The message broker can also act as a bridge between services that are from different security realms.
- Improved modifiability: The message broker shields the services of the solution from changes in individual services.
- Improved security: Communication between applications involves only the sender, the broker, and the receivers. Other applications do not receive the messages that these three exchange. Unlike bus-based integration, applications communicate directly in a manner that protects the information without the use of encryption.
- Improved testability: The message broker provides a single point for mocking. Mocking facilitates the testing of individual applications as well as of the interaction between them.