+

Search Tips | Advanced Search

Message selectors

An XMS application uses messages selectors to select the 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.

When an application is connecting to IBM WebSphere MQ Version 7.0 queue manager the message selection is done at the queue manager side. XMS does not do any selection and simply delivers the message it received from the queue manager thus providing better performance.

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 IBM MQ classes for JMS. For information about how to construct a message selector expression, see the IBM MQ product documentation 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 IBM MQ classes for JMS names. We cannot use the XMS names in a message selector expression.

Parent topic: XMS messages

Last updated: 2020-10-04