An enterprise contains several existing systems that must be able to share data and operate in a unified manner in response to a set of common business requests.
What is an architecture that enables separate applications to work together, but in a decoupled fashion such that applications can be easily added or removed without affecting the others?
Structure the connecting middleware between these applications as a Message Bus that enables them to work together using messaging.
A Message Bus is a combination of a common data model, a common command set, and a messaging infrastructure to allow different systems to communicate through a shared set of interfaces. This is analogous to a communications bus in a computer system, which serves as the focal point for communication between the CPU, main memory, and peripherals. Just as in the hardware analogy, there are a number of pieces that come together to form the message bus:
- Common communication infrastructure — Just as the physical pins and wires of a PCI bus provide a common, well-known physical infrastructure for a PC, a common infrastructure must serve the same purpose in a message bus. Typically, a messaging system is chosen to serve as the physical communications infrastructure, providing a cross-platform, cross-language universal adapter between the applications. The infrastructure may include Message Router capabilities to facilitate the correct routing of messages from system to system. Another common option is to use Publish-Subscribe Channels to facilitate sending messages to all receivers.
- Adapters — The different systems must find a way to interface with the message bus. Most commonly, this is done with commercial or custom Channel Adapters and Service Activators that can handle things like invoking CICS transactions with the proper parameters, or representing the general data structures flowing on the bus in the specific and particular way they should be represented inside each system. This also requires a Canonical Data Model that all systems can agree on.
- Common Command Structure — Just like PC architectures have a common set of commands to represent the different operations possible on the physical bus (read bytes from an address, write bytes to an address), there needs to be common commands that are understood by all the participants in the Message Bus. Command Message illustrates how this feature works. Another common implementation for this is the Datatype Channel, where a Message Router makes an explicit decision as to how to route particular messages (like Purchase Orders) to particular endpoints. It is at the end that the analogy breaks down, since the level of the messages carried on the bus are much more fine-grained than the “read/write” kinds of messages carried on a physical bus.
... Read the entire pattern in the book Enterprise Integration Patterns
Related patterns:
Canonical Data Model, Channel Adapter, Command Message, Datatype Channel, Message Router, Service Activator, Publish-Subscribe Channel