JMS message selector
A message selector allows a JMS consumer to be more selective about the messages that it receives from a particular topic or queue.
A message selector uses message properties and headers as criteria in conditional expressions. These expressions use Boolean logic to declare which messages are delivered to a client, such as the JMSInput node.
The following table demonstrates the construction of a message selector. It comprises an identifier, such as the JMSPriority header, or an application controlled property myProperty1. The selector string must specify an operator followed by a literal.
Element | Valid values |
---|---|
Identifiers |
|
Operators | AND, OR, LIKE, BETWEEN, =, <>, <,>, <=, >=, IS NULL, IS NOT NULL |
Literals |
|
The JMSInput and JMSReceive nodes provide a free format string PropertySelector, to specify selectors that filter or include application properties. These nodes also have properties for specific header properties, where the identifier is implicit and is generated by the node. For the header selectors, the operator and literal part of the string must be specified.
If
more than one selector is specified the node generates a composite
selector string, where the individual selector strings are concatenated
with the AND
operator, and each selector string part
is wrapped with parentheses.
Selector property | Description |
---|---|
PropertySelector | OrderValue> 100.00 This string is used directly as shown. In the JMSInput node, this property is configured by the Application property field. |
TimeStamp | BETWEEN 1057576423231 AND 10575788993265 Messages that are put between these two Java™ times only (where Java time is milliseconds since 01 Jan 1970 ) is delivered to the JMSInput node. In this case, the string generated is prefixed with the identifier JMSTimestamp. |
Delivery Mode | PERSISTENT This setting means
that only messages marked by the sender as being |
Priority | >= 5 AND <= 8 This
setting means that only messages marked by the sender as having a
priority |
Message ID | > WMBRK123456 This setting returns messages with a Message ID that is greater than the value specified. In this case, the string generated is prefixed with the identifier JMSMessageID. |
Redelivered | FALSE This setting means that messages that have not been redelivered are received by the node. In this case, the string generated is prefixed with the identifier JMSRedelivered. |
Correlation ID | = WMBRKABCDEFG This setting
returns messages whose Correlation ID is equal to the value |