Competing Consumers

Pattern Catalog

Previous Previous   Next Next

Site Home • Patterns Home • Table of Contents

An application is using Messaging. However, it cannot process messages as fast as they’re being added to the channel.

How can a messaging client process multiple messages concurrently?

Create multiple Competing Consumers on a single channel so that the consumers can process multiple messages concurrently.

Competing Consumers are multiple consumers that are all created to receive messages from a single Point-to-Point Channel. When the channel delivers a message, any of the consumers could potentially receive it. The messaging system's implementation determines which consumer actually receives the message, but in effect the consumers compete with each other to be the receiver. Once a consumer receives a message, it can delegate to the rest of its application to help process the message. (This solution only works with Point-to-Point Channels; multiple consumers on a Publish-Subscribe Channel just create more copies of each message.)

...

Related patterns: Event-Driven Consumer, Message, Message Channel, Message Dispatcher, Messaging, Point-to-Point Channel, Polling Consumer, Publish-Subscribe Channel, Transactional Client


Discuss this pattern on the Wiki. The Wiki allows you to add comments / suggestions for each pattern and even to add new pages. Simply follow this link and click "Edit" at the bottom of the window.   [How to use a Wiki.]  [EAI Patterns Wiki Home Page]

For a full description of the pattern see:

Enterprise Integration PatternsEnterprise Integration Patterns
Gregor Hohpe and Bobby Woolf
ISBN 0321200683
650 pages
Addison-Wesley


Home • Patterns • Table of ContentsPrevious Previous   Next Next