Defining cluster topics

Publishing and subscribing applications can publish to any topic string, with no need for an administered topic object to be defined. However, if the publishing applications are connected to a cluster queue manager that is different to the queue managers where subscriptions are created, an administered topic object must be defined and added to the cluster. To make a topic a cluster topic, you specify the name of the cluster in its definition.

Before you begin

This task assumes that you have completed the steps in Configuring the third queue manager.

About this task

The administered topic object identifies the point in the topic tree that is clustered through its topic string. Publishing and subscribing applications can use any topic string at or below that point, and their messages are automatically transmitted between queue managers.

When you define a cluster topic, you also choose its routing model. For more information about publication routing in clusters, see Designing publish/subscribe clusters.

For this scenario we use the default routing of DIRECT. This means that messages are sent direct from a publishing queue manager to the subscribing queue managers.

Procedure

  1. Define the cluster topic SCORES on PS3.

    To make the topic a cluster topic, specify the name of the cluster, and set the cluster routing ( CLROUTE ) that you want to use for publications and subscriptions for this topic.

    1. Launch the MQSC interface.
      In the command line, enter the following command:
      
       runmqsc PS3
      
    2. Define the cluster topic SCORES.
      Enter the following MQSC command:
      
       DEFINE TOPIC(SCORES) TOPICSTR('/Sport/Scores') CLUSTER(DEMO) CLROUTE(DIRECT)
      
    3. Enter end to exit the MQSC interface for PS3.
  2. Verify the topic definition on PS1.
    1. Launch the MQSC interface for PS1.
      In the command line, enter the following command:
      
       runmqsc PS1
      
    2. Display the cluster state for cluster topic SCORES.
      Enter the following MQSC command:
      
       DISPLAY TCLUSTER(SCORES) CLSTATE
      
    The CLSTATE for cluster topic SCORES is shown as ACTIVE.

What to do next

For a more detailed exploration of this task, see Configuring a publish/subscribe cluster.

You are now ready to verify the solution. See Testing the publish/subscribe cluster.