![]() |
An application is using Messaging. It consumes Messages from a Message Channel, but it does not necessarily want to consume all of the messages on that channel, just some of them.
How can a message consumer select which messages it wishes to receive?

Make the consumer a Selective Consumer, one that filteres the messages delivered by its channel so that it only receives the ones that match its criteria.
There are three parts to this filtering process:
- Specifying Producer — Specifies the message’s selection value before sending it.
- Selection Value — One or more values specified in the message that allow a consumer to decide whether to select the message.
- Selective Consumer — Only receives messages that meet its selection criteria.
... Read the entire pattern in the book Enterprise Integration Patterns
Related patterns:
Competing Consumers, Content-Based Router, Correlation Identifier, Datatype Channel, Durable Subscriber, Event-Driven Consumer, Message Filter, Guaranteed Delivery, Invalid Message Channel, Message, Message Channel, Message Dispatcher, Message Expiration, Messaging, Point-to-Point Channel, Polling Consumer, Publish-Subscribe Channel, Request-Reply, Transactional Client