This chapter describes how to manage the MessageQ MQSeries Connection environment. It covers the following tasks:
runmqsc
MQSeries Utility
Before you can start the QMB, set the MessageQ environment variables for the MessageQ bus and group to which the QMB will attach. Then, you can start the QMB processes.
To start the QMB processes, you must run the The command syntax for the QMB program is as follows:
Table 4-1 describes the QMB command parameters. Starting the Queue Message Bridge
qmbsrv
image and pass the required command parameters. You can do this in the form of a command file or directly from an interactive session. Remember that for the bridge to function correctly, you must have at least one QMBDM and QMBMD.
qmbsrv -d msg-direction -s server-type -n mgr-name
-r reply-qname -m memory-name -c pathname
-l pathname -a number -i interval
[-e] [-t]
Note that the -e
and -t
parameters generate a fair amount of information in your log files. These parameters should not be left on for extended periods.
To start the permanent QMB process, enter the following commands:
qmbsrv -d QMBDM -s PERMANENT -n MQMNAME -r DMC_REPLYQ
-m SHMNAME -c /usr/qmb/qmbprod1.cfg
-l /usr/qmb/qmbdm.log -a 60 -i 100
qmbsrv -d QMBMD -s PERMANENT -n MQMNAME -r DMC_REPLYQ
-m SHMNAME -c /usr/qmb/qmbprod1.cfg
-l /usr/qmb/qmbmd.log -a 60 -i 100
Note: Permanent QMBDM and QMBMD processes must be executing before any message exchange can occur. These processes register interest in each other and only allow message exchange if both are active.
To add an additional QMBMD server (in which messages flow from MQSeries to MessageQ), enter the following command:
qmbsrv -d QMBMD -s TEMPORARY -n MQMNAME -r DMC_REPLYQ
-m SHMNAME -c /usr/qmb/qmbprod2.cfg
-l /usr/qmb/qmbmd.log -a 60 -i 100
You can use a different configuration file (qmbprod2.cfg
) to allow specific queues to be serviced by this copy of the QMB. Using a different configuration file gives you an additional level of customization and tuning.
You can maximize the performance of the MQSeries to MessageQ connection. To do so, add a temporary QMBMD process with a configuration file designed to service a specific MQSeries LSQ. The required permanent QMBMD process polls in a round-robin fashion all MQSeries LSQs for input. You can force a temporary QMBMD process to service a subset or single LSQ or REPLYQ by specifying a tailored configuration file with the -c
parameter at startup. The rules that determine the way a temporary QMBMD process services its LSQs are as follows:
-r
parameter) is serviced.
You can stop the QMB processes in the following ways:
Stopping the Queue Message Bridge
To troubleshoot the MessageQ performance problems, use the MessageQ Monitor utility. You can use this utility to determine the status of the queues, cross-group connections, attached programs, and other information. You can also use it to determine if the messages are flowing correctly by monitoring queue detail information of the queues involved.
Use the Using the MessageQ Monitor Utility
Using the runmqsc MQSeries Utility
runmqsc
MQSeries utility to determine the state and status of the MQSeries components used by the QMB. You can use the runmqsc
utility as follows:
See the MQSeries Command Reference Manual for a complete list of valid commands.
To troubleshoot problems with MessageQ MQSeries Connection, view the log files produced by MessageQ, the QMB, and MQSeries applications. Typically, these log files also contain important information about successful and unsuccessful system events.
Note that the most efficient way to troubleshoot message queuing applications is to follow the queues used by the application. Start by making sure you are familiar with the flow of messages in your application as the message goes from queue to queue. Use the tools available on each platform to determine and follow the message flow. The most common approach is to use message counts and queue depths to follow the message.
You can view the QMB log files to troubleshoot your messaging application. The QMB produces log files that provide the following information:
Troubleshooting MessageQ MQSeries Connection Problems
Queue Message Bridge Log Files
-e
parameter indicates program event logging (all gets, puts, and so on)
Logging generates a fair amount of information; do not leave it on for extended periods of time. Trace logging is generally used to follow message flow. Event logging is used for problem determination.
Listing 4-1 shows a QMBDM log file created with the -t parameter.
Listing 4-1
QMBDM Log File
QMB: Mar 15 11:20:07 Version: 3.20 for AIX
QMB: Mar 15 11:20:07 MQS Client Maximum Active : 100
QMB: Mar 15 11:20:07 MQS Client Inactivity Timer: 60
SEM: Mar 15 11:20:07 Create: QMB_SHM_SEM
SEM: Mar 15 11:20:07 CREATE: /var/tmp/dmq/QMB_SHM_SEM Atchd:1 Locked: 0
MMF: Mar 15 11:20:07 CREATE: /var/tmp/dmq/QMB_SHM Sz:20480 Add: 805306368
MMF: Mar 15 11:20:07 Mapped: /var/tmp/dmq/QMB_SHM_MMF Sz:20480 Add: 805306368
MQS: Mar 15 11:20:07 CONN QMGR: QMGR_DWO_01 Hconn: 537500008
DMQ: Mar 15 11:20:07 Attach - Queue Number : 2.8
QMB: Mar 15 11:20:07 QMB DIRECTION is QMBDM
MQS: Mar 15 11:20:07 MQS Reply Queue: MQS_REPLYQ
DMQ: Mar 15 11:20:07 DMQ Reply Queue: DMQ_REPLYQ MRQ Address:'2.7'
QMB: Mar 15 11:20:07 QTBL DMQ LSQ COUNT: 4 MSQ LSQ COUNT: 2
QMB: Mar 15 11:20:07 SEL_MASK 537506120 Que: 0
QMB: Mar 15 11:20:07 SEL_MASK 537506172 Que: 7
.
.
.
DMQ: Mar 15 11:20:07 AVAIL REGISTRATION SUCCESS
DMQ: Mar 15 11:20:08 GET Q: 8 src: 2.99 cl: 29 ty: -1184 l: 4 e: 1
DMQ: Mar 15 11:20:07 QMB PROCESS UNAVAILABLE '2.9'
DMQ: Mar 15 11:20:14 GET Q: 8 src: 2.99 cl: 29 ty: -1183 l: 4 e: 1
DMQ: Mar 15 11:20:07 QMB PROCESS AVAILABLE '2.9'
DMQ: Mar 15 11:21:23 GET Q: 16 src: 2.222 cl: 32000 ty: -5010 l: 60 e: 1
MQS: Mar 15 11:21:23 OPEN QUEUE: MQS_REMOTE Hobj: 537433704
MQS: Mar 15 11:21:23 SEND RSQ: MQS_REMOTE Sz: 60 Per: 0 Msg: 0
DMQ: Mar 15 11:22:04 GET Q: 16 src: 2.223 cl: 32000 ty: -5010 l: 60 e: 1
MQS: Mar 15 11:22:04 SEND RSQ: MQS_REMOTE Sz: 60 Per: 0 Msg: 0
.
.
.
MQS: Mar 15 11:23:00 PUT1 Q: RSQ_15 Sz: 60 Per: 0 Msg: MQS_CLIENT
QMB: Mar 15 11:23:29 Start EXIT_HANDLER PROCESSING
QMB: Mar 15 11:23:29 TERMINATE PROGRAM SIGNAL (SIGTERM)
MMF: Mar 15 11:23:29 WRITE : /var/tmp/dmq/QMB_SHM_MMF Bytes: 20480
MMF: Mar 15 11:23:29 Close : /var/tmp/dmq/QMB_SHM_MMF
SEM: Mar 15 11:23:29 DELETE: /var/tmp/dmq/QMB_SHM_SEM
MMF: Mar 15 11:23:29 DELETE: /var/tmp/dmq/QMB_SHM Sz:20480 Add: 805306368
MQS: Mar 15 11:23:29 CONN QMGR: QMGR_DWO_01 Disconnect Complete
You can use the MQSeries log files to determine any failures or events associated with the various components. Here is how to locate the MQSeries log files:
/var/mqm/qmgrs/QMGRNAME/errors/AMQERR01.LOG
For first failure support technology, use the following pathname:
In the previous file location, nnnnn is the process ID reporting the error and mm is a sequence number, which is normally 0.
/var/mqm/qmgrs/@SYSTEM/errors/AMQERR01.LOG
/var/mqm/errors/AMQnnnnn.mm.FDC
On your distribution kit, MessageQ MQSeries Connection provides the source and makefile for an example utility that facilitates the sending of control messages to the QMB processes. This utility allows you to control the behavior of a target QMB process, without having to close the process or rewrite the client or server application to send the desired control message to the QMB process.
The MessageQ MQSeries Connection utility is called Note that you can modify the The Table 4-2 describes the valid control functions by message type. Using the MessageQ MQSeries Connection Utility
dmc_util
. Before you can use this utility, you must create the executable using the makefile provided. The source file (dmc_util.c
) and the makefile (dmc_util.mak
) for this utility are located in the /usr/kits/DMC32B/examples
(or /usr/kits/DMC32C/examples
) directory.
dmc_util
source file to better meet the needs of your project. If you do this, copy the source and makefile to your working directory before you make any modifications.
How the MessageQ MQSeries Connection Utility Works
dmc_util
sends a message containing the appropriate MessageQ class and message type to perform the desired control function. In most cases, this message is sent to the QMB primary queue.
The dmc_util
sends most control messages to the QMBDM primary queue (which is also the default target [QMBDM] ). However, some control messages work on a specific QMBDM or QMBMD process and must be directed to that process' group and queue. For example, you can terminate a specific temporary QMB process without terminating the permanent process.
The dmc_util
allows you to change the target group and queue so that control messages can be sent to queues other than the QMBDM primary queue (the default target).
Before you can run the dmc_util
, you must make the executable file. Also, you must set the DMQ_BUS_ID and DMQ_GROUP_ID environment variables. Then, you can run the dmc_util
by entering the following command:
% dmc_util
The dmc_util
displays a main menu as shown in Listing 4-2.
Listing 4-2 The dmc_util Main Menu
MessageQ MQSeries Connection Utility (V3.2)
1) Toggle the QMB event log switch (MSG_TYPE_EVENT_LOG)
2) Toggle the QMB trace log switch (MSG_TYPE_TRACE_LOG)
3) Force load of QMB config file (MSG_TYPE_LOAD_CONFIG)
4) Close old and open new log file (MSG_TYPE_NEW_LOG)
5) Purge non-persistent CI only (MSG_TYPE_PURGE_CI)
6) Purge all CI (MSG_TYPE_PURGE_CI_ALL)
7) Dump MQMD to Log File (MSG_TYPE_DUMP_QTABLES)
8) Dynamic Service Registration (MSG_TYPE_RSQ_REGISTER)
9) Terminate the QMB processes (MSG_TYPE_TERMINATE)
10) Change target group and queue
11) Set target group and queue to default [QMBDM] primary
12) Exit this utility
Default Target [QMBDM] 5.12
Current Target Default [QMBDM] 5.12
Enter Message Choice:
Note the group.queue (5.12) number in the current target field at the bottom of the main menu. It is to this target that control messages are sent. See the Understanding Current and Default Target Groups and Queues topic for more information.
After you invoke dmc_util
, it displays the default target line at the bottom of the main menu. The default target line display differs depending on whether or not the target was located when the dmc_util
was started. Table 4-3 describes the target line display.
After dmc_util
is started, the current target maybe changed to any group.queue using the menu message choice 10 (change target group and queue).
After you enter a new target group and queue, the dmc_util
displays a message similar to the following:
Current Target Group : [x] Queue : [x]
Note that it is this current target group that dmc_util
control messages are sent to. Control messages must be sent to their proper target for the desired QMB action to take place.
Most of the dmc_util
control messages just need a target and message type in order to complete the requested action. There are some control messages, which require some additional information, and the dmc_util
prompts for this information.
You can select message choice 9 to terminate the QMB process that you specify. If you select this message choice, the menu shown in Listing 4-3 will appear:
Listing 4-3 Terminate Queue Message Bridge Process Menu
1) Terminate QMBDM & all temporary instances (MessageQ to MQSeries)
2) Terminate QMBMD & all temporary instances (MQSeries to MessageQ)
3) Terminate a single temporary QMB instance (DMQ Address required)
4) Terminate QMBDM, QMBMD and all temporary instances (Bridge Set)
Select terminate choice or <CR> to exit:
You can change the registration of a queue using the Dynamic Service Registration message choice (8). When you select this message choice to change the MessageQ RSQ, the dialog as shown in Listing 4-4 will appear:
Listing 4-4 Dynamic Service Registration for a MessageQ RSQ
Enter LSQ name to assign the RSQ to:
Enter LSQ Owner (M or D):
Enter RSQ MessageQ Queue Address
Enter group number:
Enter queue number:
When you select this message choice to change the MQSeries RSQ, the dialog as shown in Listing 4-5 will appear:
Listing 4-5 Dynamic Service Registration for an MQSeries RSQ
Enter LSQ name to assign the RSQ to:
Enter LSQ Owner (M or D):
Enter MQSeries queue name of RSQ:
See the Registering Remote Service Queues topic for more information.
Message choice 4 (Close old and open new log file) in the main menu closes the current target (QMBDM and QMBMD) and opens a new log file. The new log file has the same name as the old log file except that the new one has a tilde (~) appended to the end. For example, if the current log file name is dmc_dm.log
, this message choice causes the log file to be closed and the dmc_dm.log~
to be created. Subsequent invocations of this message choice causes another tilde to be appended to the end of the file name. In this case, dmc_dm.log~~
will be created.
To exit the dmc_util
, select message choice 12 (exit this utility).