Message Dispatcher - Enterprise Integration Patterns (original) (raw)
An application is using Messaging. The application needs multiple consumers on a single Message Channel to work in a coordinated fashion.
How can multiple consumers on a single channel coordinate their message processing?
Create a Message Dispatcher on a channel that will consume messages from a channel and distribute them to performers.
A Message Dispatcher consists of two parts:
- Dispatcher – The object that consumes messages from a channel and distributes each message to a performer.
- Performer – The object that is given the message by the dispatcher and processes it.
When a Message Dispatcher receives a message, it obtains a performer and dispatches the message to the performer to process it. A performer can delegate to the rest of its application to help process its message. The performer could be newly created by the dispatcher, or could be selected from a pool of available performers. Each performer can run in its own thread to process messages concurrently. All performers may be appropriate for all messages, or the dispatcher may match a message to a specialized performer based on properties of the message.
Message Dispatcher Sequence
...Read the entire pattern in the book Enterprise Integration Patterns
Related patterns:
Competing Consumers, Datatype Channel, Remote Procedure Invocation, Event-Driven Consumer, Message Channel, Selective Consumer, Messaging, Point-to-Point Channel, Polling Consumer, Publish-Subscribe Channel, Claim Check, Transactional Client
Integration Pattern Language
The Software Architect Elevator
Rethink the role of architects as a connecting element across organizational layers. Acquire the technical, communication, and organizational skills to succeed in this new role.
Cloud Strategy
Make your cloud migration a success by translating high-level goals into conscious decisions with well-understood trade-offs.
Platform Strategy
Platforms can boost innovation through harmonization, but they aren't easy to build. Learn from over a decade of designing and rolling out IT platforms.