Clustering: Example configuration of multiple cluster transmission queues
In this task you apply the steps to plan multiple cluster transmission queues to three overlapping clusters. The requirements are to separate messages flows to one cluster queue, from all other message flows, and to store messages for different clusters on different cluster transmission queues.
For the example, there are two requirements. One is to separate the message flow from the gateway queue manager to the sales application that logs sales. The second is to query how many messages are waiting to be sent to different departmental areas at any point in time. The SALES, FINANCE, and DEVELOP clusters are already defined. Cluster messages are currently forwarded from SYSTEM.CLUSTER.TRANSMIT.QUEUE.
The steps to modify the clusters are as follows; see Figure 3 for the definitions.
There is
no strong reason for choosing this default, as the intention is to
manually define cluster transmission queues. The choice does have
a weak diagnostic value. If a manual definition is done wrongly, and
a message flows down a default cluster transmission queue, it shows
up in the creation of a permanent-dynamic cluster transmission queue.
The example requires adding the queue manager SALESRV to a new cluster within the sales department. If we have few queues that require isolation, you might decide on creating a specific cluster for the SALES queue. A possible naming convention for the cluster name is to name such clusters, Q. QueueName, for example Q.SALES. An alternative approach, which might be more practical if you have a large number of queues to be isolated, is to create clusters of isolated queues where and when needed. The clusters names might be QUEUES. n.
In the example, the new cluster is called Q.SALES. To add the new cluster, see the definitions in Figure 3. The summary of definition changes is as follows:
Add Q.SALES to the namelist of clusters on the repository queue managers. The namelist is referred to in the queue manager REPOSNL parameter.
Add Q.SALES to the namelist of clusters on the gateway queue manager. The namelist is referred to in all the cluster queue alias and cluster queue manager alias definitions on the gateway queue manager.
Create a namelist on the queue manager SALESRV, for both the clusters it is a member of, and change the cluster membership of the SALES queue:
DEFINE NAMELIST(CLUSTERS) NAMES(SALES, Q.SALES) REPLACE
ALTER QLOCAL(SALES) CLUSTER(' ') CLUSNL(SALESRV.CLUSTERS)
The SALES queue is a member of both clusters, just for the transition. Once the new configuration is running, you remove the SALES queue from the SALES cluster; see Figure 4.
Add the cluster-receiver channel Q.SALES. RepositoryQMgr to each of the repository queue managers
Add the cluster-sender channel Q.SALES. OtherRepositoryQMgr to each of the repository queue managers, to connect to the other repository manager. Start these channels.
Add the cluster receiver channels Q.SALES.SALESRV, and Q.SALES.GATE to either of the repository queue managers that is running.
Add the cluster-sender channels Q.SALES.SALESRV, and Q.SALES.GATE to the SALESRV and GATE queue managers. Connect the cluster-sender channel to the repository queue manager that you created the cluster-receiver channels on.
Switch to the new configuration on the gateway queue manager.
The switch is triggered by starting the new channels, and restarting the channels that are now associated with different transmission queues. Alternatively, we can stop and start the gateway queue manager.
Stop the following channels on the gateway queue manager:
SALES. Qmgr
DEVELOP. Qmgr
FINANCE. Qmgr
Start the following channels on the gateway queue manager:
The definitions and instructions to create the example cluster, and modify it to isolate the SALES queue and separate messages on the gateway queue manager.
About this task
The full MQSC commands to create the FINANCE, SALES, and Q.SALES clusters are provided in Figure 2, Figure 3, and Figure 4. The definitions for the basic clusters are in Figure 2. The definitions in Figure 3 modify the basic clusters to isolate the SALES queue, and to separate cluster messages to FINANCE and SALES. Finally, to remove the SALES queue from the SALES cluster; see Figure 4. The DEVELOP cluster is omitted from the definitions, to keep the definitions shorter.
Procedure
Create the SALES and FINANCE clusters, and the gateway queue manager.
Create the queue managers.
Run the command: crtmqm -sax -u SYSTEM.DEAD.LETTER.QUEUE QmgrName for each of the queue manager names in Table 1.
Description
Queue manager name
Port number
Finance repository
FINR1
1414
Finance repository
FINR2
1415
Finance client
FINCLT
1418
Sales repository
SALER1
1416
Sales repository
SALER2
1417
Sales server
SALESRV
1419
Gateway
GATE
1420
Start all the queue managers
Run the command: strmqm QmgrName for each of the queue manager names in Table 1.
Create the definitions for each of the queue managers
Run the command: runmqsc QmgrName < filename where the files are listed in Figure 2, and the file name matches the queue manager name.
Test the configuration by running the sample request program.
Start the trigger monitor program on the SALESRV queue manager
On Windows, open a command window and run the command runmqtrm -m SALESRV
Run the sample request program, and send a request.
On Windows, open a command window and run the command amqsreq A.SALES FINCLT
The request message is echoed back, and after 15 seconds the sample program finishes.
Create the definitions to isolate the SALES queue in the Q.SALES cluster and separate cluster messages for the SALES and FINANCE cluster on the gateway queue manager.
Run the command: runmqsc QmgrName < filename where the files are listed in Figure 3, and the file name almost matches the queue manager name.
Switch the channels to the new transmission queues.
The requirement is to stop and start all the channels that the GATE queue manager is using. To do this with the least number of commands, stop and start the queue manager
Rerun the sample request program to verify the new configuration works; see step 2
Monitor the messages flowing through all the cluster transmission queues on the GATE queue manager:
Alter the definition of each of the cluster transmission queues to turn queue monitoring on.
ALTER QLOCAL(SYSTEM.CLUSTER.TRANSMIT.
name) STATQ(ON)
Check queue manager statistics monitoring is OFF, to minimize output, and set the monitoring interval to a lower value to perform multiple tests conveniently.
ALTER QMGR STATINT(60) STATCHL(OFF) STATQ(OFF) STATMQI(OFF) STATACLS(OFF)
Restart the GATE queue manager.
Run the sample request program a few times to verify that an equal number of messages are flowing through SYSTEM.CLUSTER.TRANSMIT.Q.SALES.SALESRV and SYSTEM.CLUSTER.TRANSMIT.QUEUE. Requests flow through SYSTEM.CLUSTER.TRANSMIT.Q.SALES.SALESRV and replies through SYSTEM.CLUSTER.TRANSMIT.QUEUE.
One request and reply message were sent in the first interval and two in the second. We can infer that the request messages were placed on SYSTEM.CLUSTER.TRANSMIT.Q.SALES.SAVESRV, and the reply messages on SYSTEM.CLUSTER.TRANSMIT.QUEUE.