Tags

WebSphere MQ Client Configuration

In the typical WebSphere MQ installation, both the MQ Server and the MQ Client features are installed. However, the MQ Client can be installed on a system where the MQ Server component is not installed, and no queue manager runs. In this configuration the MQ Client can do message queuing to one, or many queue managers that reside on different machines.

If you have never used the WebSphere MQ Client feature and want to give it a try, here is a quick and easy way to configure an MQ Client to connect to a queue manager on an MQ Server. In this example the Client is connecting to a queue manager on a WebSphere MQ for Windows server using the MQSERVER environment variable.

Understanding the difference between a Server program and a Client programMQ Server programs:

Compiled with the server libraries.

Run on the same machine as the Server (queue managers).

Connect only to queue managers on, the local machine.

MQ Client programs:

Compiled with the client libraries.

Run on any machine that has the Client feature installed.

Connect to queue managers on, local or remote machines.

Configuring the WebSphere MQ ClientYou need to do some set-up on both the Server and the Client machines. On the Server side you need to create a queue manager, define a queue, and define a server connection channel. On the client side you need to 'SET' or 'EXPORT' the MQSERVER environment variable, which includes: channel name, transport type, and the host name / listener port of the queue manager.

Testing the Client ConfigurationRun the AMQSPUTC client program from the same command prompt where the MQSERVER environment variable is set.

AMQSPUTC SERVER.LOCAL.QUEUE SERVER.QMGR

AMQSPUTC is the client 'c' sample program

SERVER.LOCAL.QUEUE is the name of the queue.

SERVER.QMGR the name of the queue manager.

Click image to enlarge

Results of testing: The message was delivered to the SERVER.LOCAL.QUEUE as expected.

Click image to enlarge

Common client problems:

Queue manager not running (on server).

Listener not running (on server).

Wrong host name or port number in MQSERVER environment variable (on client).

Channel not defined correctly (client and server channels must have the same name).

Authorization problems.

Client program not compiled with client stub or library.

Note: When a client program attempts to connect to the server and the connection fails. The client program will most often likely fail with MQRC 2059, or MQRC 2058.

MQRC 20592059 0x0000080b MQRC_Q_MGR_NOT_AVAILABLE

MQRC 20582058 0x0000080a MQRC_Q_MGR_NAME_ERROR

There are many things to consider for the production environment that are not discussed in this post. Refer to the WebSphere MQ Information Center, Overview of WebSphere MQ clients, for the complete details.