IBM Support

Connecting MQ clients to multiple queue managers via a Client Channel Definition Table (CCDT)



You encounter problems when trying to connect your WebSphere MQ (WMQ) client applications to more than one queue manager. You want to know how to connect an MQ client to more than one queue manager.


Typical return codes when you are encountering problems:

2058 0x0000080a MQRC_Q_MGR_NAME_ERROR
2059 0x0000080b MQRC_Q_MGR_NOT_AVAILABLE

Resolving The Problem

To connect a client to multiple queue managers you can use a Client Channel Definition Table (CCDT). In UNIX the channel table is created on the server machine in the /mqmtop/qmgrs/QUEUEMANAGERNAME/@ipcc directory when you define your client connection channels.

- You can define multiple client connection channels for the different queue managers to which you want the client to connect.

- You need to ensure that each queue manager has a corresponding server connection channel for the client connection channel defined for that queue manager in the CCDT.

- Copy the client channel table (AMQCLCHL.TAB) from the server machine to the client machine as a binary file. This can be copied into any directory that you choose on the client machine.

- In the client application, you will need to have multiple MQCONNs for each of the queue managers to which you want to connect, and use appropriately the corresponding queue manager handle for each connection, which will use a different server-connection channel.

- On the client machine you must unset the MQSERVER environment variable:

Windows: set MQSERVER=


- On the client machine you must set the MQCHLLIB and MQCHLTAB environment variables.
+ The MQCHLLIB environment variable must have the fully qualified path to the CCDT file.

+ The MQCHLTAB environment variable must have the name of the CCDT file.

For example, if you copied the client channel table into the /var/mydir directory, then you can set the environment variables on a UNIX system by typing:

export MQCHLLIB=/var/mydir

The MQCHLLIB can be in any directory that you choose on the client.

- You should only copy the channel table on the server machine to the client machines. You should not delete the channel table from the server machine: it is not recreated by the queue manager.

- This will work the same on all platforms except OpenVMS. The client channel table file is binary so will be able to be read on all platforms.

- For more detailed information see: Accessing client-connection channel definitions

- See MQCHLLIB and MQCHLTAB for more information.

- The following high availability sample program uses automated client reconnection and moves a message from the queue of a source queue manager to a remote queue manager.
The source code illustrates how to handle separate connections to multiple queue managers.
Windows: MQ_INSTALL\tools\c\Samples\amqsmhac.c
Unix: MQ_INSTALL/samp/amqsmhac.c


[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Clients","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF021","label":"OpenVMS"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"8.0;7.5;7.1;7.0.1;7.0;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

WebSphere MQ WMQ

Document Information

Modified date:
15 June 2018