Testing the publish/subscribe cluster

Test the publish/subscribe cluster by publishing and subscribing to a topic string from different queue managers in the cluster.

Before you begin

This task assumes that you have completed the steps inDefining cluster topics.

About this task

Using the command line, and the amqspub and amqssub sample applications that are included with IBM® MQ , you can publish a topic from one queue manager and subscribe to the topic with the other queue managers. When a message is published to the topic, it is received by the subscribing queue managers.

Procedure

  1. In the command line, enter the following command:
    
     amqspub /Sport/Scores/Football PS1
    
  2. Concurrently, in separate command lines, enter the following commands:
    
     amqssub /Sport/Scores/Football PS2
    
    
     amqssub /Sport/Scores/Football PS3
    
  3. In the first command line, enter a message.
    The message is displayed in both the subscribing command lines.
    Note: The amqssub application will time out if a publication is not received for ten seconds.

Results

The publish/subscribe cluster set up is complete.

What to do next

Try defining different topic objects for different branches of the topic tree, and with different routing models.