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.
... Read the entire pattern in the book Enterprise Integration 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