Topic strings

Label information you publish as a topic using a topic string. Subscribe to groups of topics using either character or topic based wildcard topic strings.


Topics

A topic string is a character string that identifies the topic of a publish/subscribe message. We can use any characters you like when you construct a topic string.


Topic string

Any Unicode character

Three characters have special meaning in Version 7 publish/subscribe. They are allowed anywhere in a topic string, but use them with caution. The use of the special characters is explained in Topic-based wildcard scheme.

    A forward slash ( /)

    The topic level separator. Use the '/' character to structure the topic into a topic tree.

    Avoid empty topic levels, '//', if we can. These correspond to nodes in the topic hierarchy with no topic string. A leading or trailing '/' in a topic string corresponds to a leading or trailing empty node and should be avoided too.

    The hash sign ( #)

    Used in combination with '/' to construct a multilevel wildcard in subscriptions. Take care using '#' adjacent to '/' in topic strings used to name published topics. Examples of topic strings shows a sensible use of '#'.

    The strings '.../#/...', '#/...' and '.../#' have a special meaning in subscription topic strings. The strings match all topics at one or more levels in the topic hierarchy. Thus if you created a topic with one of those sequences, you could not subscribe to it, without also subscribing to all topics at multiple levels in the topic hierarchy.

    The plus sign ( +)

    Used in combination with '/' to construct a single-level wildcard in subscriptions. Take care using '+' adjacent to '/' in topic strings used to name published topics.

    The strings '.../+/...', '+/...' and '.../+' have a special meaning in subscription topic strings. The strings match all topics at one level in the topic hierarchy. Thus if you created a topic with one of those sequences, you could not subscribe to it, without also subscribing to all topics at one level in the topic hierarchy.


Examples of topic strings

IBM/Business Area#/Results
IBM/Diversity/%African American

  • Wildcard schemes
    There are two wildcard schemes used to subscribe to multiple topics. The choice of scheme is a subscription option.

Parent topic: Topics


Related information