Publish/subscribe cluster scenario
In this scenario you create a simple three queue manager cluster and configure it to allow subscriptions created on one queue manager to receive messages published by an application connected to another queue manager.
Before starting
The starting point for this scenario is an existing IBM MQ installation. For instructions to install IBM MQ, follow the steps in Installing an IBM MQ server on Windows.
About this task
By completing the steps in this scenario, you first create the following cluster: .
This cluster consists of three queue managers, two of which are defined as full repository queue managers.
You then define a cluster topic on queue manager PS3. By creating the cluster topic, you have made the cluster into a publish/subscribe cluster. To test the publish/subscribe cluster, you subscribe to the topic on any queue manager, then publish a message to the topic from another queue manager and check that your subscription receives the message.
- Create and starting the queue managers
Create and start three queue managers, called PS1, PS2 and PS3.- Configure the first queue manager
Use the MQSC interface to define a listener and a receiver channel for PS1, to set the queue manager as a full repository for the cluster, and to define a sender channel from PS1 to PS2 so the two full repositories can exchange information.- Configure the second queue manager
Use the MQSC interface to define a listener and a receiver channel for PS2, to set the queue manager as a full repository for the cluster, and to define a sender channel from PS2 to PS1 so the two full repositories can exchange information.- Configure the third queue manager
Use the MQSC interface to define a listener and a receiver channel for PS3. Join PS3 into the cluster by defining a sender channel from PS3 to one of the full repository queue managers.- 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.- 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.Parent topic: Publish/subscribe scenarios
Related information