+

Search Tips   |   Advanced Search

Message selection and filtering

Message selection and filtering can occur when a consumer attaches to a destination.

When attaching to a destination, a consumer can provide a "selector", a filter expression indicating the messages it is prepared to accept. The filter expression is a predicate referencing named fields in the message header or body. A particular instance of this occurs in the field of publish/subscribe, where subscribing applications typically express an interest in one or more topics and the selector is then a filter on the topic field carried in a message header. In JMS 1.1, selector expressions are restricted to referencing fields in the JMS header and the JMS properties of the JMS message; there is no access to the message body.

Use the default messaging provider, a topic is an identifier that a producer puts in the header of a message to enable message selection by consumers. The topics are grouped into topic namespaces, which have a tree-like hierarchical structure with a single root. This allows a subscriber (consumer) to connect with a wildcard selector that matches on an entire topic namespace, or a subtree of that namespace.

  • Message properties support for mediations