An XMS application uses messages selectors to select which messages it wants to receive.
When an application creates a message consumer, it can associate a message selector expression with the consumer. The message selector expression specifies the selection criteria. XMS determines whether each incoming message satisfies the selection criteria. If a message satisfies the selection criteria, XMS delivers the message to the message consumer. If a message does not satisfy the selection criteria, XMS does not deliver the message and, in the point-to-point domain, the message remains on the queue.
An application can create more than one message consumer, each with its own message selector expression. If an incoming message satisfies the selection criteria of more than one message consumer, XMS delivers the message to each of these consumers.
JMSPriority > 3 AND manufacturer = 'Jaguar' AND model in ('xj6','xj12')XMS delivers a message to a message consumer with this message selector expression only if the message has a priority greater than 3, an application defined property, manufacturer, with a value of Jaguar, and another application defined property, model, with a value of xj6 or xj12.
The syntax rules for forming a message selector expression in XMS are the same as those in WebSphere MQ JMS. For information about how to construct a message selector expression therefore, see WebSphere MQ Using Java. Note, in particular, that, in a message selector expression, the names of JMS defined properties must be the JMS names, and the names of IBM defined properties must be the WebSphere MQ JMS names. You cannot use the XMS names in a message selector expression.