+

Search Tips | Advanced Search

Topics

A topic identifies what a publication is about. Topic names are characters strings. Subscriptions can include wildcard characters to retrieve the information required by the application. IBM MQ Publish/Subscribe recognizes the asterisk (*) and the question mark (?) as wildcard characters.


Topic names

Topic names are strings of characters. You could have high-level topics named 'Sport', 'Stock', 'Films', and 'TV', and you could divide the 'Sport' topic into separate, more specific topics covering different sports; for example:
Sport/Soccer Sport/Golf Sport/Tennis
These topics could then be divided further, to separate different types of information about each sport:
Sport/Soccer/Fixtures Sport/Soccer/Results Sport/Soccer/Reports

IBM MQ Publish/Subscribe does not recognize that the forward slash (/) character is being used in a special way but if we use the forward slash (/) character as a separator, we can ensure compatibility with other WebSphere business integration applications.

We can use any character in the single-byte character set for which the machine is configured in a character string. Consider, however, whether the topic string might need to be translated to a different character representation, in which case you must use only those characters that are available in the configured character set of all relevant machines.

Topic strings are case sensitive, and a blank character has no special meaning. As a subscriber, you can specify a topic or range of topics using wildcards to receive the information in which you are interested.


Wildcards in topic strings

IBM MQ Publish/Subscribe recognizes the following wildcard characters:
Wildcard character Meaning
Asterisk (*) Zero or more characters
Question mark (?) One character
For example, you could use the following topic strings in subscriptions to retrieve particular sets of information:

If you want to include the asterisk (*) or question mark (?) in the topic string of a subscription, you must use the percent sign (%) as an escape character. For example, if you want to subscribe to a topic that is named ABC*D, you must enter the string ABC%*D.

If you want to use a % character in the topic string of a subscription, you must specify two percent signs (%%). A percent sign (%) in a topic string must always be followed by an asterisk (*), a question mark (?), or another percent sign (%).

Wildcards do not span streams.