Chapter 3 . Configuring MessageQ MQSeries Connection

This chapter describes the tasks required to define queues and configure your system to support MessageQ MQSeries Connection, including:


Overview of Configuration Tasks

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:

After you know these elements of your application, configure each message queuing system according to the instructions provided with the message queuing system, as follows:

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:

The programming examples and supporting files are located in the following directory:

/usr/kits/DMC32B/templates (or in /usr/kits/DMC32C/templates)

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".


Configuring MessageQ

For each MessageQ message queuing group that communicates with an MQSeries application, you must set up the MessageQ group initialization file (DMQINIT.TXT).

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:

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.

Group Name Table

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.


Configuring MQSeries

This topic describes how to configure MQSeries to use MessageQ MQSeries Connection. It includes the following tasks:

Configuring the Required MQSeries Queues

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 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.

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 /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.

Defining MQSeries Queues

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.

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, xmitq, and others.) must exist and be active to allow MQSeries distributed processing to occur.

A template file defining all the MQSeries queues required to run the programming examples is located in:

/usr/kits/DMC32B/templates/DMC320_MQMDEF.CFG (or /usr/kits/DMC32BC/templates/DMC320_MQMDEF.CFG)

To load the MQM with the required commands to include the example QMB queue definitions, enter the following command:

runmqsc YOURMQMNAME DMC320_MQMDEF.CFG mqmdef.out

The mqmdef.out file contains the results of the command executions.

Tips for Configuring MQSeries

Note the following tips when configuring an MQSeries queue:

See the MQSeries Command Reference Manual for detailed information on how to configure MQSeries software.


Configuring the Queue Message Bridge

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 DMC320_CONFIG.DAT, is located in /usr/kits/DMC32B/templates (or in /usr/kits/DMC32C/templates).

The configuration file is passed to the QMB at startup time using the -c command parameter and the path and filename of the configuration file. For example:

qmbsrv -c /usr/qmb/qmb.cfg

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.
Table 3-1 Parameters in the Queue Message Bridge Configuration File

Field Description

LSQ Name

Name of the Local Service Queue defined in either MessageQ or MQSeries. This queue receives messages to be forwarded to the associated RSQ. MessageQ LSQs must be multireader queues and in the same group to which the QMB attaches. MQSeries LSQs must be shared queues that are defined in the MQM. The QMB connects to this queue.

LSQ Owner

Indicates the messaging system that owns the LSQ as follows:

RSQ Name

Name of the Remote Service Queue associated with the LSQ. The RSQ is the target queue for a message send.

If a name is specified, the target queue is static. If a period (.) is specified, it serves as a placeholder for dynamic queue association. This is the final target for all message sends. The RSQ may be located anywhere in the target messaging system accessible to the local MessageQ group or MQSeries MQM. MessageQ RSQs require an entry in the group name table if they are not defined in the local group. MQSeries RSQs require a QREMOTE definition if they are not defined in the local MQM.

RSQ Association

Method of Remote Service Queue registration as follows:

Format Name

This name, if present, will become the message descriptor Format parameter. If the MQSeries channel definition associated with the RSQ allows character conversion the named conversion exit will be invoked.

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.

Registering Remote Service Queues

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:

In the QMB configuration file, static or dynamic association of an RSQ to an LSQ is determined by the RSQ association parameter of the LSQ entry. The RSQ association parameters are as follows:

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.