WebSphere Message Brokers
File: aq01130_
Writer: Terry Cowling

Concept topic

This build: July 31, 2007 21:35:06

Topics

A topic is a character string that describes the nature of the data that is published in a publish/subscribe system.

Topics are key to the successful delivery of messages in a publish/subscribe system. Instead of including a specific destination address in each message, a publisher assigns a topic to the message. The message broker matches the topic with a list of clients (subscribers) who have subscribed to that topic, and delivers the message to each of those clients.

Note that a publisher can control which subscribers can receive a publication by choosing carefully the topic that is specified in the message.

Topics can be defined by a system administrator using the workbench. However, the topic of a message does not have to be defined before a publisher can use it; a topic can also be defined when it is specified in a publication for the first time.

More than one topic can be specified for a publication.

A topic string can include any character from the Unicode character set, including the space character. However, there are three characters that have special meanings. These characters ("/", "#", and "+") are described in Special characters in topics.

Although a null character does not cause an error, do not use null characters in your topic strings.

Topic trees

Although you can use any name for a topic, choose a name that fits into a hierarchical tree structure. Thoughtful design of topic names and topic trees can help you with the following operations:
  • Subscribing to multiple topics.
  • Establishing security policies.
  • Automatically reacting to messages on a specific topic; for example, by sending an alert to a manager's pager.

Each topic that you define is an element, or node, in the topic tree. The topic tree can either start empty or contain topics that have been defined by a system administrator using the workbench. You can define a new topic either by using the workbench or by specifying the topic for the first time in a publication.

Although you can construct a topic tree as a flat, linear structure, it is better to build a topic tree in a hierarchical structure with one or more root topics.

The following figure shows an example of a topic tree with one root topic:
This figure shows a topic tree. At the top of the tree is the root node USA. The next level of the tree shows two nodes beneath the root node. These nodes are Alabama and Alaska. Beneath the nodes at this level are the nodes Auburn, Mobile, and Montgomery, under Alabama, and the node Juneau, under Alaska.

Each character string in the figure represents a node in the topic tree. A complete topic name is created by aggregating nodes from one or more levels in the topic tree. Levels are separated by the "/" character. The format of a fully specified topic name is: "root/level2/level3".

The valid topics in the topic tree shown above are:
  • "USA"
  • "USA/Alabama"
  • "USA/Alaska"
  • "USA/Alabama/Auburn"
  • "USA/Alabama/Mobile"
  • "USA/Alabama/Montgomery"
  • "USA/Alaska/Juneau"

When you design topic names and topic trees, remember that the message broker does not interpret, or attempt to derive meaning from, the topic name itself. It uses the topic name only to send related messages to clients who have subscribed to that topic.

Related tasks
Publishing
Subscribing
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:35:06

aq01130_ This topic's URL is: