How to install IBM MQ Client on windows and connect to QMGR

In this we will learn how to download IBM MQ client ,Install on Windows server ,Connect to Remote QMGR using the channel TAB .

Download latest IBM MQ Client from the support site .

Once the file is downloaded successfully extract the zip .

Run setup.exe

Set MQCHLLIB and MQCHLTAB variables

set MQCHLLIB=C:\ProgramData\IBM\MQ

Define Channel TAB using below command and runmqsc -n

define chl(CL.APPQM1) chltype(CLNTCONN) CONNAME('') QMNAME(APPQM1)

2035 Permission error is because we use ameadmin from the mqclient to connect to QMGR but that id doesnt exist on the remote server to start the SVRCONN Channel . Usually we can use use chlauthentication to map client id with mcauser that can start the channel .

Below error observed in the QMGR Logs

----- cmqxrsrv.c : 2580 -------------------------------------------------------
01/20/2021 02:20:46 PM - Process(8074.19) User(mqm) Program(amqrmppa)
                    Host( Installation(Installation1)
                    VRMF( QMgr(APPQM1)
                    ArithInsert1(2) ArithInsert2(2035)

AMQ9557E: Queue Manager User ID initialization failed for 'ameadmin'.

The call to initialize the User ID 'ameadmin' failed with CompCode 2 and
Reason 2035. If an MQCSP block was used, the User ID in the MQCSP block was ''.
If a userID flow was used, the User ID in the UID header was '' and any CHLAUTH
rules applied prior to user adoption were evaluated case-sensitively against
this value.
Correct the error and try again.
----- cmqxrsrv.c : 2580 ------------------------------------------------------

Create ameadmin id and add to mqm group so that channel can start and we will be able to connect successfully and post the messages using amqsputc.exe

useradd ameadmin
id ameadmin
usermod -a -G mqm ameadmin
id ameadmin

Let us try to browse these message from the QMGR directly

[mqm@ip-172-31-14-154 ~]$ /opt/mqm/samp/bin/amqsget TESTCLIENT APPQM1
Sample AMQSGET0 start
message <Test1>
message <Test2>
message <Test3>
message <Test4>
message <Test5>
no more messages
Sample AMQSGET0 end
[mqm@ip-172-31-14-154 ~]$ 

We can also connect to QMGR from client by setting MQSERVER

On Windows

SET MQSERVER=channelName/TCP/server-address(port)

On Linux/Unix/Aix

export MQSERVER=channelName/TCP/'server-address(port)'

Hope this help for testing MQ client connectivity to QMGR .

Thanks for Reading!!!

Related Posts

Leave a Reply

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