WebSphere WebSphere Business Integration Message Service Clients for C/C++ Version 1.2.7 and .NET Version 1.2.6 Operating Systems: AIX, Linux, Solaris, Windows

Message selectors

An XMS application uses messages selectors to select the messages it to receives.

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 meet 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 meets the selection criteria of more than one message consumer, XMS delivers the message to each of these consumers.

A message selector expression can reference the following properties of a message:
  • JMS-defined properties
  • IBM-defined properties
  • Application-defined properties
It can also reference the following message header fields:
  • JMSCorrelationID
  • JMSDeliveryMode
  • JMSMessageID
  • JMSPriority
  • JMSTimestamp
  • JMSType
A message selector expression, however, cannot reference data in the body of a message.
Here is an example of a message selector expression:
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, see WebSphere MQ Using Java. Note 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.

Related reference
Parts of an XMS message
Header fields in an XMS message
Properties of an XMS message
The body of an XMS message
Mapping XMS messages onto WebSphere MQ messages

Reference topic

Terms of Use | Rate this page

Last updated: 18 Jun 2008

© Copyright IBM Corporation 2005, 2008. All Rights Reserved.