How to create a qmgr alias

2019-07-29 06:16发布

I have a virtual ip which points to 2 servers having qmgrs qm1 and qm2 respectively. I need a qmgr alias to give it to another application so that they can call the virtual ip with the the qmgr alias and the qmgr alias should point to the particular server's qmgr accordingly.

What I did:
I have created qmgr alias as follows.
In server 1 with QM1:

Define qremote(QMALIAS)  rname('')  rqmname(QM1)  xmitq(x)

In server2:

Define qremote(QMALIAS)  rname('')  rqmname(QM2)  xmitq(x)

I get a 2059 error from the other application when it tries to access the virtualip and QMALIAS.

I use IBM MQ. Can someone please help?

标签: linux ibm-mq
1条回答
The star\"
2楼-- · 2019-07-29 06:19

You said you get a 2059 error from the application, I think you mean a 2058 (MQRC_Q_MGR_NAME_ERROR).

In the QREMOTE definitions for a QMALIAS you should leave the XMITQ blank:

DEFINE QREMOTE(QMALIAS) RNAME('') RQMNAME(QM1) XMITQ('')
DEFINE QREMOTE(QMALIAS) RNAME('') RQMNAME(QM2) XMITQ('')

On the client side you have two choices to make this work:

  1. Do not specify the queue manager name on the MQCONN call, either leave it blank (NULL) or spaces only.
  2. Place a * in the queue manager name on the MQCONN call, ex: *QMALIAS or simply *.

This will cause the client to not check that the RQMNAME matches the name in the MQCONN call and it will then not produce the 2058 (MQRC_Q_MGR_NAME_ERROR).

Also note that if you leave the BASE QMNAME blank on MQOPEN calls you do not need the QMALIAS entries for client apps. If you need to also support remote queue managers connecting through the VIP, then you will need the QMALIAS for that purpose.

查看更多
登录 后发表回答