Manage queue sharing groups
We can add or remove a queue manager to a queue sharing group (QSG), and manage the associated Db2 tables.
This topic has sections about the following tasks:
- Set up a queue sharing group
- Adding a queue manager to a queue sharing group
- Removing a queue manager from a queue sharing group
- Removing a queue sharing group from the Db2 tables
- Validating the consistency of Db2 definitions
Set up a queue sharing group
Each queue sharing group has a name of up to four characters. The name must be unique in your network, and must be different from any queue manager names. Follow these steps to set up a queue sharing group:
- If this is the first queue sharing group to use the Db2 data-sharing group, set up the Db2 environment.
- Set up the coupling facility.
- Add the queue sharing group to the Db2 tables. Use the ADD QSG function of the queue sharing group utility (CSQ5PQSG). This program is described in The queue sharing group utility. A sample is provided in thlqual.SCSQPROC(CSQ45AQS).
- Add a queue manager to the queue sharing group by following the steps in Adding a queue manager to a queue sharing group
- Define application structures to IBM MQ by following the steps in Adding a coupling facility structure.
- If required, migrate non-shared queues to shared queues.
- For availability, create shared channels into and out of the queue sharing group.
- For connections into the queue sharing group:
- Set up a VIPA socket or hardware router to distribute workload between the available queue managers in the QSG.
- Define a receiver channel with QSGDISP(GROUP), to ensure the channel definition is available on all queue managers in the QSG.
- Start a listener with INDISP(GROUP), on each queue manager, for MCA channel connections into the QSG. Client connections into the QSG should still connect to a listener started with INDISP(QMGR).
- Change applications to connect using the QSG name, rather than a specific queue manager name.
- Ensure that the channel authentication rules on all queue managers in the QSG are the same, to allow applications to connect to any queue manager in the QSG.
- For connections out of the queue sharing group:
- Define a shared transmission queue.
- Define the outbound channel with QSGDISP(GROUP) and DEFCDISP(SHARED).
If you convert an existing channel to a shared channel, you might need to issue the RESET CHANNEL command before starting the channel as the synchronization queue used by the channel will have changed.
Adding a queue manager to a queue sharing group
A queue manager can be added to an existing queue sharing group.
Note that:
- The queue sharing group must exist before we can add queue managers to it.
- A queue manager can be a member of only one queue sharing group.
Follow these steps to add a queue manager to a queue sharing group:
- Perform the tasks in implement ESM security controls for the queue sharing group to grant the appropriate access to the queue manager and channel initiator user IDs.
- If the queue sharing group has CF structures configured to offload data to SMDS, perform the tasks in set up the SMDS environment.
- Stop the queue manager.
- Use the ADD QMGR function of the queue sharing group utility (CSQ5PQSG). This program is described in the queue sharing group utility. A sample is provided in thlqual.SCSQPROC(CSQ45AQM).
- Change the system parameter module to add queue sharing group data:
- Modify CSQ6SYSP to specify the QSGDATA parameter. See using CSQ6SYSP for more information.
- Assemble and link the system parameter module. We might want to use a different name for the load module.
- Change your startup process to use the new module.
- Copy and tailor sample member thlqual.SCSQPROC(CSQ4INSS), which defines required CF structures and SYSTEM queues. Add the customized member to the CSQINP2 DD in the queue manager startup JCL.
- Restart your queue manager using the queue sharing group system parameter module.
- Optionally, migrate to security profiles prefixed by the queue sharing group name, instead of the queue manager name.
- If shared channels are used for connections into the QSG, create channel authentication rules that mirror those on the other queue managers in the QSG, to allow applications to connect to any queue manager in the QSG.
- 10. Optionally, do either of the following to allow applications connected to the queue manager in the QSG to put messages to queues hosted by other queue managers in the QSG:
- Turn on intra-group queuing by issuing the command ALTER QMGR IGQ(ENABLED).
- Define transmission queues and channels to the other queue managers in the QSG. Defining transmission queues with the same name as the target queue managers avoids the need to define remote queues and queue manager aliases.
Note: To add a queue manager to an existing queue sharing group containing queue managers running earlier versions of IBM MQ, we must first apply the coexistence PTF for the highest version of IBM MQ in the group to every earlier version queue manager in the group.
Removing a queue manager from a queue sharing group
We can only remove a queue manager from a queue sharing group if the queue manager's logs are not needed by another process, and all SMDS owned by the queue manager are empty.
The logs are needed if they contain:
- The latest backup of one of the coupling facility (CF) application structures used by the queue sharing group
- Data needed by a future restore process, that is, the queue manager has used a recoverable structure since the time described by the last backup exclusion interval value.
If either or both of these points apply, or an SMDS owned by the queue manager contains messages, the queue manager cannot be removed. To determine which queue managers' logs are needed for a future restore process, use the MQSC DISPLAY CFSTATUS command with the TYPE(BACKUP) option (for details of this command, see DISPLAY CFSTATUS ). Use the following steps to remove a queue manager from a queue sharing group:
- Stop any applications connected to the queue manager that put messages to shared queues.
- Resolve any indoubt units of work involving this queue manager.
- Determine if there are any messages in any SMDS owned by the queue manager by issuing the command DISPLAY USAGE TYPE(SMDS).
- If there are offloaded messages for any application structure, wait until those messages have been retrieved from the queue. The number of offloaded messages reported by DISPLAY USAGE TYPE(SMDS) should be zero before proceeding.
- Shut the queue manager down cleanly using STOP QMGR MODE(QUIESCE).
- Wait for an interval at least equivalent to the value of the EXCLINT parameter we will specify in the BACKUP CFSTRUCT command in the next step.
- On another queue manager, run a CF structure backup for each recoverable CF structure by using the MQSC BACKUP CFSTRUCT command and specifying an EXCLINT value as required in the previous step.
- Confirm that the queue manager's logs are not needed to restore any CF structures, by inspecting the output from the command DISPLAY CFSTATUS(*) TYPE(BACKUP).
- Use the REMOVE QMGR function of the CSQ5PQSG utility to remove the queue manager from the queue sharing group. This program is described in The queue sharing group utility. A sample is provided in thlqual.SCSQPROC(CSQ45RQM).
- Before restarting the queue manager, reset the QSGDATA system parameter to its default value, and recreate the system parameter module. See Use CSQ6SYSP for information about how to tailor the system parameters.
Note, that when removing the last queue manager in a queue sharing group, we must use the FORCE option, rather than REMOVE. This removes the queue manager from the queue sharing group, while not performing the consistency checks of the queue manager logs being required for recovery. We should only perform this operation if we are deleting the queue sharing group.
Removing a queue sharing group from the Db2 tables
To remove a queue sharing group from the Db2 tables, use the REMOVE QSG function of the queue sharing group utility (CSQ5PQSG). This program is described in The queue sharing group utility. A sample is provided in thlqual.SCSQPROC(CSQ45RQS).
We can only remove a queue sharing group from the common Db2 data-sharing group tables after you have removed all the queue managers from the queue sharing group (as described in Removing a queue manager from a queue sharing group ).
When the queue sharing group record is deleted from the queue sharing group administration table, all objects and administrative information relating to that queue sharing group are deleted from other IBM MQ Db2 tables. This includes shared queue and group object information.
Validating the consistency of Db2 definitions
Problems for shared queues within a queue sharing group can occur if the Db2 object definitions have, for any reason, become inconsistent.
To validate the consistency of the Db2 object definitions for queue managers, CF structures, and shared queues, use the VERIFY QSG function of the queue sharing group utility (CSQ5PQSG). This program is described in The queue sharing group utility.
Parent topic: Manage queue sharing groups and shared queues on z/OS