JMS Selectors

Selectors are a way of attaching a filter to a subscription to perform content based routing. Selectors are defined using SQL 92 syntax and typically apply to message headers; whether the standard properties available on a JMS message or custom headers you can add via the JMS code.

Here is an example

JMSType = 'car' AND color = 'blue' AND weight > 2500

For more documentation on the detail of selectors see the reference on javax.jmx.Message.
ActiveMQ supports some JMS defined properties, as well as some ActiveMQ ones - see message properies - that the selector can use.

Using XPath to filter messages

Apache ActiveMQ also supports XPath based selectors when working with messages containing XML bodies. To use an XPath selector use the following syntax

XPATH '//title[@lang=''eng'']'
Xalan dependency
XPath support requires Xalan which is not part of the distribution. The Xalan jars needs to be manually added to lib directory or pulled into your app via maven
<dependency>
    <groupId>xalan</groupId>
    <artifactId>xalan</artifactId>
    <version>2.6.0</version>
</dependency>
© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram