Connect a queue manager to a publish/subscribe hierarchy

You connect the child queue manager to the parent queue manager in the hierarchy. If the child queue manager is already a member of another hierarchy or cluster, then this connection joins the hierarchies together, or joins the cluster to the hierarchy.


Before starting

  1. Queue managers in a publish/subscribe hierarchy must have unique queue manager names.
  2. A publish/subscribe hierarchy relies on the queued publish/subscribe queue manager feature. This must be enabled on both the parent and the child queue managers. See Starting queued publish/subscribe.
  3. The publish/subscribe relationship relies on queue manager sender and receiver channels. There are two ways to establish the channels:

    • Add both the parent and child queue managers to a IBM MQ cluster. See Adding a queue manager to a cluster.
    • Establish a sender/receiver channel pair from the child queue manager to the parent and from the parent to the child. Each channel either needs to use a transmission queue with the same name as the target queue manager, or a queue manager alias with the same name as the target queue manager. For more information about how to establish a point-to-point channel connection, see IBM MQ distributed queuing techniques.

    For examples that configure a hierarchy over each type of channel configuration, see the following set of publish/subscribe hierarchy scenarios:


About this task

Use the ALTER QMGR PARENT (PARENT_NAME) runmqsc command to connect children to parents. This configuration is performed on the child queue manager, where PARENT_NAME is the name of the parent queue manager.


Procedure

ALTER QMGR PARENT(PARENT_NAME)


Example

The first example shows how to attach queue manager QM2 as a child of QM1, then query QM2 to confirm it has successfully become a child with a STATUS of ACTIVE:

C:>runmqsc QM2
5724-H72 (C) Copyright IBM Corp. 1994, 2020.  ALL RIGHTS RESERVED.
Starting MQSC for queue manager QM2
alter qmgr parent(QM1)
     1 : alter qmgr parent(QM1)
AMQ8005: IBM MQ queue manager changed.
display pubsub all
     2 : display pubsub all
AMQ8723: Display pub/sub status details.
   QMNAME(QM2)                             TYPE(LOCAL)
   STATUS(ACTIVE)
AMQ8723: Display pub/sub status details.
   QMNAME(QM1)                             TYPE(PARENT)
STATUS(ACTIVE)
The next example shows the result of querying QM1 for its connections:
C:\Documents and Settings\Admin>runmqsc QM1
5724-H72 (C) Copyright IBM Corp. 1994, 2020.  ALL RIGHTS RESERVED.
Starting MQSC for queue manager QM1.
display pubsub all
     2 : display pubsub all
AMQ8723: Display pub/sub status details.
   QMNAME(QM1)                             TYPE(LOCAL)
   STATUS(ACTIVE)
AMQ8723: Display pub/sub status details.
   QMNAME(QM2)                             TYPE(CHILD)
   STATUS(ACTIVE)
If STATUS does not show as ACTIVE, check that the channels between the child and the parent are correctly configured and running. Check both queue manager error logs for possible errors.


What to do next

By default, topics used by publishers and subscribers on one queue manager are shared with publishers and subscribers on the other queue managers in the hierarchy. Administered topics can be configured to control the level of sharing through use of the SUBSCOPE and PUBSCOPE topic properties. See Configure distributed publish/subscribe networks. Parent topic: Configure distributed publish/subscribe networks


Related concepts


Related tasks


Related information