Service messaging provides a communication platform through which messages are transmitted and routed as independent units. It brings the efficient execution of loosely coupled service interactions and data exchanges.
Off the shelf, message-oriented middleware (MOM) queues are the best example of service messaging. MOM queues can have a single sender or receiver or multiple senders and receivers, and some applications even require to use of multiple Queues will help in decoupling discreet and distinct components of a system.
Most SOA implementations use MOM queues, and it is hard to find an SOA-compliant system without a messaging system.
The benefits of service messaging are as follows:
- A service messaging pattern in your design makes your design solution a best fit and elegant for any clients who want to communicate to services asynchronously
- It is an implementation of loose coupling and one of the core principles of SOA
- With service messaging, the following are made easy and elegant:
- Fail-safe and loop back in services
- Versioning of services
- Record, defer, and replay
- Multiplexed messages
- Best fit for concurrency models as immutable messages are thread safe
The impacts of service messaging are as follows:
- Asynchronous communications lead to reliability concerns in some cases, unlike the services that receive the client response immediately
- As service messaging involves Asynchronous communication to other systems, there may be a need to engage further systems that manage and supports the service process and executions (more systems to be operated and maintained).
- Need to rely more on messaging systems (dependency on messaging systems)