The topic level separator is used to introduce structure into the topic, and can therefore be specified within the topic for that purpose.
The multilevel wildcard and single-level wildcard can be used for subscriptions, but they cannot be used within a topic by the publisher of a message.
The topic level separator character "/" is used to provide a hierarchical structure to the topic space. It must be used by applications to separate levels within a topic tree. The use of the topic level separator is significant when the two wildcard characters are encountered in topics specified by subscribers.
Topic hierarchy is important in the administration of access control.
The multilevel wildcard character "#" is used to match any number of levels within a topic. For example, using the example topic tree shown above, if you subscribe to "USA/Alaska/#", you receive messages on topics "USA/Alaska" and "USA/Alaska/Juneau".
The multilevel wildcard can represent zero or more levels. Therefore, "USA/#" can also match the singular "USA", where # represents zero levels. The topic level separator is meaningless in this context, because there are no levels to separate.
The multilevel wildcard can be specified only on its own or next to the topic level separator character. Therefore, "#" and "USA/#" are both valid, but "USA#" is not valid.
The single-level wildcard character "+" matches one, and only one, topic level. For example, "USA/+" matches "USA/Alabama", but not "USA/Alabama/Auburn". Also, because the single-level wildcard matches only a single level, "USA/+" does not match "USA".
The single-level wildcard can be used at any level in the topic tree, and in conjunction with the multilevel wildcard. The single-level wildcard must be specified next to the topic level separator, except when it is specified on its own. Therefore, "+" and "USA/+" are both valid, but "USA+" is not valid
Notices |
Trademarks |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
aq13290_ |