WebSphere MQ

How to Connect to WebSphere MQ Queue Manager using mqclient.ini?

You can find a full version of the mqclient.ini file from IBM Documentation. However, below are the parameters which are mostly needed for a basic connection to work:

CHANNELS:
DefRecon=YES
ServerConnectionParms=MYSVRCONN/TCP/localhost(1414)

Save the file under /var/mqm. If there is a file available already, feel free to add the above snippet at the end.

By default, the /var/mware/mqclient.ini is the default path, but you can always use below environment variable to change the path:

export MQCLNTCF=<path of the file>

As mentioned here, there is a particular order, in which the client configurations are loaded according to precedence. Note that if MQSERVER variable is defined, mqclient.ini will be ignored. Hence, validate that MQSERVER valiable is unset, before testing this mode of connection.

Once all set, and queue manager is RUNNING, you can issue below command to connect and send message to respective queue:

/opt/mqm/samp/bin/amqsputc <qmgr>

For assurance that mqclient.ini is being used, you can rename and try the connection. It should fail with below errors:

Sample AMQSPUT0 start
MQCONNX ended with reason code 2058

Leave a Reply

Your email address will not be published. Required fields are marked *