Wildcards

Wildcards can be used by subscribing applications to broaden the scope of publications that they register an interest in. By specifying a wildcard, the subscriber is specifying a general pattern of the topics they are interested in, rather than an explicit topic.

Wildcards are used by both MQSeries Publish/Subscribe and WebSphere Business Integration Event Broker. However, WebSphere Business Integration Event Broker provides a different set of wildcards that allow a more extensive and flexible use of wildcards by subscribers.
  • MQSeries Publish/Subscribe wildcards are:
    • An asterisk (*); this matches zero or more characters.
    • A question mark (?); this matches exactly one character.
    • The percent sign (%); this can be used as an escape character to use an "*", a "?", or a "%" character within a topic.
  • WebSphere Business Integration Event Broker wildcards are:
    • The multilevel wildcard (the character #); this matches any number of levels at the start or end of the topic.
    • The single-level wildcard (the character +); this matches a single level within the topic.

    The characters used are:

The full range of function of the WebSphere Business Integration Event Broker wildcards are only available to MQRFH2 clients. Subscriptions made by MQRFH clients to WebSphere Business Integration Event Broker brokers for topics that contain either of the WebSphere Business Integration Event Broker wildcards are rejected with the reason code MQRCCF_TOPIC_ERROR.

Applications using MQRFH and connecting to MQSeries Publish/Subscribe brokers in a heterogeneous network should therefore not publish on, or subscribe to, topics that contain either the multilevel wildcard (#) or single-level wildcard (+) characters. MQSeries Publish/Subscribe brokers do not police this; if your applications specify the WebSphere Business Integration Event Broker wildcards in topics when they publish or register a subscription in a heterogeneous broker network, these publications and subscriptions are ignored by WebSphere Business Integration Event Broker brokers within the network. You are therefore strongly advised to review and if necessary change the topics being used within a MQSeries Publish/Subscribe implementation before adding a WebSphere Business Integration Event Broker broker to the network.

When applications that use MQRFH2 use the WebSphere Business Integration Event Broker wildcards to target multiple publications from within the MQSeries Publish/Subscribe network, wildcard mapping is performed. In most cases, the broker replaces both the multilevel wildcard and single-level wildcard characters with an asterisk. This does not provide an exact match for either of the WebSphere Business Integration Event Broker wildcards, but ensures that a superset of the required publications are sent to the WebSphere Business Integration Event Broker broker. The WebSphere Business Integration Event Broker broker evaluates the "#" and "+" wildcards to match the correct publications.

For example, the topic "employee/+/development" is propagated as "employee/*/development" to a MQSeries Publish/Subscribe neighbor. This might cause redundant publications to be sent to the WebSphere Business Integration Event Broker broker from its MQSeries Publish/Subscribe neighbor. However, none of these would be sent to the original client when the WebSphere Business Integration Event Broker evaluates the original subscription.

The exception to this is a subscription to the topic "+" which is never propagated; it cannot be represented as an "*" because this is the topic that is propagated if a subscription to topic "#" is made at the WebSphere Business Integration Event Broker broker.

Do not specify MQSeries Publish/Subscribe wildcard characters in MQRFH2 client subscriptions. If you do specify one or more, they are assumed by WebSphere Business Integration Event Broker to be part of the topic, and are therefore prefixed by the escape character (%) before the subscription is sent on to a MQSeries Publish/Subscribe neighbor.

For example, if your MQRFH2 client subscribes with a topic of "USA/Alaska*/Juneau?", this is modified and passed to a MQSeries Publish/Subscribe broker neighbor as "USA/Alaska%*/Juneau%?".

If an application using MQRFH connects to a WebSphere Business Integration Event Broker broker, WebSphere Business Integration Event Broker emulates the behavior of the MQSeries Publish/Subscribe wildcard characters * and ? using a mixture of its own wildcard characters and filter expressions. Existing MQRFH applications that subscribe to a WebSphere Business Integration Event Broker broker therefore receive the same publications as they would receive if they subscribe to a MQSeries Publish/Subscribe broker.