Topic names and use of wildcard characters in topic expressions

Wildcard characters can be used in topic expressions to retrieve topics provided by the default messaging provider and service integration technologies.

Each subscribe request includes a topic expression that identifies one or more topics that the subscription is to be associated with, and that the request uses to match against incoming messages.

Subscription topic expressions for the default messaging provider and service integration technologies are based on a subset of the XPath location path syntax.

Identifying individual topics

Every topic in a topic space has a topic name consisting of one or more name parts, separated by / (forward slash) characters:
Topic name = name_part | (name_part '/' topic_name)

Using wildcards to identify multiple topics

To select one or more topics in a topic space, you can use a topic path, a location path that contains wildcard characters. Topic spaces are evaluated by using a subset of the XPath location path syntax with the <topicspace> element as the initial context node, so that non-wildcarded topic paths look exactly like topic names.

The syntax for topic paths can be summarized as follows:
  • A topic path that contains no * (asterisk), // (double forward slash), or . (dot) symbols is asking for an exact match with the topic name specified.
  • A * (asterisk) can be used as a wild card and matches one level (regardless of the value of the name part at that level)

    A * can be used anywhere in a topic path expression, but if it isn't at the start it must be preceded by a /, and if it is isn't at the end it must be followed by a /

  • // can be used as a wild card and matches 0 or more levels

    A // can be used anywhere in the expression except at the end. To match 0 or more levels at the end of the expression you end the expression with the syntax //. (double-slash dot). To match one or more levels at the end use //* (double-slash asterisk)

    A topic path must not contain more than two consecutive / symbols.

The following table lists some example topic paths showing the XPath syntax and the equivalent WBI Message Broker selectors:
Table 1. XPath syntax and WBI Message Broker selectors
Topic path Topics selected WBI Message Broker equivalent
A/B Selects the B child of A A/B
A/* Selects all children of A A/+
A//* Selects all descendents of A A/#/+
A//. Selects A and all descendents of A A/#
//* Selects everything # (or #/+)
A/./B Equivalent to A/B A/B
A/*/B Selects all B grandchildren of A A/+/B
A//B Selects all B descendents of A A/#/B
//A Selects all A elements at any level #/A
* Selects all first level elements +

Interoperation with Version 5.1 clients

Existing WebSphere® Application Server Version 5.1 client applications using Version 5.1 connection factory and destination definitions use the WBI Message Broker wildcard convention. Such applications can connect to the default messaging provider and service integration bus, and automatically have their wildcard syntax mapped to the XPath convention when subscriptions are created. Any display of these subscriptions through an administrative interface to the bus shows the XPath syntax.

Reference topic    

Terms of Use | Feedback

Last updated: Oct 21, 2010 1:44:59 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-express-dist&topic=rjo0002_
File name: rjo0002_.html