This chapter describes the tasks required to define queues and configure your system to support MessageQ MQSeries Connection, including:
Before you configure MessageQ MQSeries Connection, become familiar with the MessageQ and MQSeries applications and queues that your application will access. Specifically, you must know the following:
Overview of Configuration Tasks
After you complete the configuration for each message queuing system, configure MessageQ MQSeries Connection using the QMB configuration file.
The MessageQ MQSeries Connection media kit contains programming examples of an MQSeries to MessageQ application. It also contains example configuration and initialization files which support the programming examples. These files are as follows:
DMC320_CONFIG.DAT
, which is the QMB configuration file. This file contains the LSQ to RSQ relationship.
The programming examples and supporting files are located in the following directory:
Use programming examples and supporting files to help you understand how to configure the MessageQ MQSeries Connection software. For more information on the programming examples, see Appendix B, "Programming Examples".
For each MessageQ message queuing group that communicates with an MQSeries application, you must set up the MessageQ group initialization file ( The MessageQ group initialization file that supports a QMB set must include the appropriate queue definitions required for the QMB servers and all offered MessageQ local services.
A QMB set requires the following queue entries in the QCT section of the group initialization file:
/usr/kits/DMC32B/templates
(or in /usr/kits/DMC32C/templates
)
Configuring MessageQ
DMQINIT.TXT
).
DMQ_
r
, where r
is the value passed in the -r
qname
parameter of the QMB start command. For example, if you specify -r REPLYQ
, then the actual MessageQ queue name is DMQ_REPLYQ. For more information on the -r
parameter, see the Starting the Queue Message Bridge topic.
The group initialization file must also include a QCT entry for each LSQ. These queues must be defined as permanent multireader queues.
Listing 3-1 provides an example of a MessageQ initialization file queue entry section. In this example, the QMBDM, QMBMD, and DMQ_REPLYQ are required queues for the QMB server. The queues LSQ_TEST and MQS_ECHO are LSQs and DMQ_ECHO_SERVER is an RSQ.
Listing 3-1
MessageQ Configuration File Queue Entry Section
!QUEUE CONFIGURATION SECTION
!
% QCT
!Queue Queue Byte Msg Quota UCB Queue Owner Conf Perm Name
!Name Number Quota Quota Enable Send Type Queue Style Active Scope
!
QMBDM 8 64000 100 None . P 0 . N L N
QMBMD 9 64000 100 None . P 0 . N L N
DMQ_DMC_REPLYQ 7 64000 100 None . M 0 . Y L N
LSQ_TEST 11 32000 10 None . M 0 . Y L N
MQS_ECHO 12 64000 100 None . M 0 . Y L N
DMQ_ECHO_SERVER 15 64000 100 None . M 0 . N L N
Note that the actual values of QNUM, BYTE QUOTA, and MSG QUOTA for each entry are determined by other existing queue configuration entries, message sizes, and arrival rate calculations for the QMB application.
If your application requires multiple QMB servers, the additional servers attach to MessageQ Temporary Primary Queues (TPQs) and associate themselves with the appropriate permanent QMB server. No MessageQ configuration entries are required when using TPQs with additional instances of a QMB server.
See the MessageQ Installation and Configuration Guide for UNIX for more information on the MessageQ configuration file and configuring MessageQ.
Any MessageQ service that is not local to the group with the QMB must have an entry in the group name table. This table allows MessageQ MQSeries Connection to locate the actual queue address when it processes the RSQ entries in the QMB configuration file.
For example, suppose DMQ_ECHO_SERVER defined in the QMB configuration file did not reside in the MessageQ group defined previously. In that case, MessageQ MQSeries Connection requires a group name table entry to allow address resolution. If the DMQ_ECHO_SERVER program was on a remote group such as group 5/queue 24, the entry is as follows:
!Qname Group.Queue Scope
DMQ_ECHO_SERVER 5.24 L
The appropriate MessageQ cross-group configuration entries must be in place to allow access to remote services, which exist in other MessageQ groups.
See the MessageQ Installation and Configuration Guide for UNIX for more information on the MessageQ configuration file and configuring MessageQ.
This topic describes how to configure MQSeries to use MessageQ MQSeries Connection. It includes the following tasks:
A QMB set requires that an MQSeries permanent shared queue be configured for an MQSeries reply queue and all offered Local Service Queues. These queues must be configured in the same Message Queue Manager (MQM) that the QMB connects to and have the same characteristics of the MQSeries queue model defined in Listing 3-2.
The reply queue name must be Each LSQ that the QMB services must also be defined in the MQM.
Listing 3-2 shows a sample definition of the QMODEL for an MQSeries LSQ. The source for this model is located in the Configuring the Required MQSeries Queues
MQS_
r
, where r
is the value passed in the -r
parameter of the QMB startup command line. The QMB prefixes the constant MQS_
to the -r
parameter for a complete name. For more information on the -r
parameter, see the Starting the Queue Message Bridge topic.
/usr/kits/DMC32B/templates
(or /usr/kits/DMC32C/templates
) directory. This model may be copied to the MQM configuration file or added manually. To add manually, use the define
and alter
commands from the runmqsc
MQSeries utility.
Listing 3-2
MQSeries Queue Definition
DEFINE QMODEL(`QMBLSQ') +
DESCR(`QMB Local Service Queue Model') +
PUT(ENABLED) +
DEFPRTY(0) +
DEFPSIST(NO) +
GET(ENABLED) +
MAXDEPTH(5000) +
MAXMSGL(32000) +
SHARE +
DEFSOPT(SHARED) +
MSGDLVSQ(PRIORITY) +
USAGE(NORMAL) +
NOTRIGGER +
RETINTVL(999999999) +
BOTHRESH(0) +
BONAME(` `) +
SCOPE(QMGR) +
QDEPTHHI(80) +
QDEPTHLO(20) +
QDPMAXEV(ENABLED) +
QDPHIEV(DISABLED) +
QDPLOEV(DISABLED) +
QSVCINT(999999999) +
QSVCIEV(NONE)
The plus sign in Listing 3-2 is an IBM line continuation character.
You can modify the Message Queue Manager configuration by either executing the runmqsc
utility interactively or editing and loading the command file associated with the MQM. See the MQSeries Command Reference and System Management Guide for more information.
If the QMODEL defined in was added to the command file, you can use the following examples to define the QMB required queues with the runmqsc utility.
DEFINE QLOCAL(MQS_REPLYQ) LIKE(QMBLSQ)
Any remote service offered on the local MQM must be defined as QLOCAL. Any remote service that is not on the local MQM must be defined as QREMOTE to allow the messages be forwarded to it. Also, all Distributed Queue Manager (DQM) definitions (channels, A template file defining all the MQSeries queues required to run the programming examples is located in:
To load the MQM with the required commands to include the example QMB queue definitions, enter the following command:
The Note the following tips when configuring an MQSeries queue:
xmitq
, and others.) must exist and be active to allow MQSeries distributed processing to occur.
/usr/kits/DMC32B/templates/DMC320_MQMDEF.CFG
(or /usr/kits/DMC32BC/templates/DMC320_MQMDEF.CFG
)
runmqsc YOURMQMNAME DMC320_MQMDEF.CFG mqmdef.out
mqmdef.out
file contains the results of the command executions.
Tips for Configuring MQSeries
The queue can grow to the maximum size of (/var/mqm/qmgrs/QNAME/queues
MAXDEPTH * largest_message
) received. By default, MQSeries is installed in the /var
directory, which is generally not a large file system. If a large volume of messages is expected, install or move MQSeries to an alternate disk with adequate disk space available.
See the MQSeries Command Reference Manual for detailed information on how to configure MQSeries software.
Use the QMB queue configuration file to define the services offered by one messaging system to the other. The QMB processes read the configuration file and set up the logic required to associate an LSQ to an RSQ. This association can be statically or dynamically established. An LSQ is a queue that is local to the sending applications messaging system. An RSQ is a queue that is remote to the sending applications messaging system and is the final target of all messages received on the associated LSQ.
The QMB configuration file is an ASCII text file. Parameters within the file are separated by white space and the file may be located in any directory. An example configuration file, named The configuration file is passed to the QMB at startup time using the A configuration file entry consists of the following parameters. These parameters must be specified on the same line and in the following order as shown in Table 3-1. Configuring the Queue Message Bridge
DMC320_CONFIG.DAT
, is located in /usr/kits/DMC32B/templates
(or in /usr/kits/DMC32C/templates
).
-c
command parameter and the path and filename of the configuration file. For example:
qmbsrv -c /usr/qmb/qmb.cfg
A QMB server process reads the configuration file passed with the command line, resolves all name-to-address issues, and builds a internal table to allow LSQ to RSQ mapping.
In the following example, MessageQ clients have access to MQSeries servers through the following MessageQ LSQs:
Likewise, MQSeries clients have access to MessageQ servers through the following MQSeries LSQs:
Listing 3-3 shows the QMB configuration file to support this case.
Listing 3-3
Queue Message Bridge File
! QMB Config File to Support ECHO Servers
!
!LSQ LSQ RSQ RSQ
!Name Owner Name Association
!
MQS_ECHO D MQS_ECHO_SERVER S
MQSTEST D . D
!
DMQ_ECHO M DMQ_ECHO_SERVER S
DMQTEST M . D
Note that an LSQ with a dynamic RSQ association must have a program registered to it before it can be used. Any messages received before registration are returned to the sender with the appropriate Return To Sender (RTS) message type.
Note that reply queues are built from the command line -r
parameter and are not required to be defined in the QMB configuration file.
An RSQ must be registered to an LSQ before any message may be forwarded to it. The RSQ registration may be statically defined in the QMB configuration file or dynamically associated at runtime. There are two things that you must do to register an RSQ dynamically:
All messages received on the defined LSQ are forwarded to the RSQ name or address. Messages received on an LSQ that does not have a registered RSQ are returned to the sender. This scheme allows the server application the ability to be moved between various MessageQ groups or MQSeries MQMs.
Listing 3-4 shows a registration message data structure.
Listing 3-4
Registration Message Data Structure
typedef struct
{
char lsq[49]; /* (MAX_MQS_LEN = 49) */
char lowner; /* LSQ Owner [D]MQ or [M]QS */
char rsq[49]; /* RSQ name of MQS Appl Queue */
char rfu; /* Reserved for Future Use */
q_address rsq_add; /* DMQ Address of DMQ RSQ */
}
rsq_reg_struct;
Data structures and MessageQ class and type definitions are supplied in the qmbuser.h
file, which is located in the/usr/kits/DMC32B/include
(or /usr/kits/DMC32C/include
) directory.
For more information on the QMB configuration file, see the Configuring the Queue Message Bridge topic.