Typically, you use MessageSelectors in implementations of IBM JMS products (both for the implementation of WebSphere MQ and SIBus). This is the equivalent of a filter that scans an HTTP or SOAP message header for web protocols.
Although this may not be what you want, it is actually a clean and thoughtful design.
However, if you do not want to use MessageSelectors, you probably have to create your own and βprocessβ the message using the built-in MDB, which scans the headers and then forwards the message to the appropriate queue, where only the MDB that takes care of the grouped messages will process them (like a gateway / message selection pattern).
If you use a "pure" JMS API, you can ask the Session object to create a MessageConsumer with the specified selector string (the value in the header) that you want to filter (again you need to set this yourself).
This is all that gives you a clean JMS API. Everything else depends only on the developer of the messaging technology, which is then patented for their implementation, and not portable code.
Chris aldrich
source share