|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Concept of a queue manager alias |
« View previous topic :: View next topic » |
Author |
Message
|
scott9 |
Posted: Thu Jan 12, 2006 11:42 pm Post subject: Concept of a queue manager alias |
|
|
Acolyte
Joined: 11 Jul 2002 Posts: 62 Location: Sacramento,CA
|
I've spent several hours reading documentation and reading posts here on queue manager aliases and I still cannot figure it out. I'm using amqsput, which may be my problem. The sample app requires two parameters:
1. QUEUE NAME
2. QMGR <if blank, it uses the default QMGR>
I want to connect locally to QMGR QM1, but put a message to a local queue called QL.TEST on QMGR QM2. (I know this could be done with RNAME in a QREMOTE definition, but I want to see how a QMGR alias works.)
This is what I've done:
Created QMGR QM1 as the default QMGR on one system, then created QMGR QM2 on a different system.
On QM2:
def ql(QL.TEST)
def chl(qm1.to.qm2) chltype(rcvr)
On QM1:
def qr(QM2) rname(' ') rqmname(QM2) xmitq(XMITQ.QM2) <this is my QMGR alias>
def qr(QR.TEST) rname(QL.TEST) rqmname(QM2) <this is a control to verify that my chls and xmitq work>
def ql(XMITQ.QM2) usage(XMITQ)
def chl(qm1.to.qm2) ...<chl starts fine>
On the system that host QMGR QM1 I execute:
`amqsput QR.TEST QM1` <of course this works...simple qr example>
`amqsput QL.TEST QM2` <fails with 2058 MQRC_Q_MGR_NAME_ERROR>
I expect this, because QMGR QM2 doesn't exist on the system that hosts QMGR QM1; however, the documentation leads me to bellieve that the application will really connect to QM1, but route the message to QL.TEST at QM2. This is confusing, because the application must first connect to QM1 to resolve the QMGR alias QM2. How does the application know to connect to QM1 if I pass it QM2 as the QMGR name?
P.S. `amqsput QL.TEST` also fails. It connects to QM1 (default QMGR), but cannot find object QL.TEST (MQRC_UNKNOWN_OBJECT_NAME) as expected. This whole thing is quite humbling...anybody got a link to WMQ for Dummies?! |
|
Back to top |
|
 |
Mr Butcher |
Posted: Fri Jan 13, 2006 12:48 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
your setup looks fine. the problem is amqsput program.
amqsput connects to the queuemanager specified and opens the queue specified. but it does not issue the open with queuename and qmgrname.
what you need is a program like this (in sympolic terms)
parms targetqueue targetqmgr localqmgr
mqconnect(localqmgr)
mqopen(targetqueue,targetqmgr)
mqput
mqclose
mqdisconnect
a queue is opened with objectname and objectqmgrname
if objectqmgrname is blank or the name of the local queuemanager, then mq looks for a local definition of the queue specified in objectname.
if an objectqmgrname is specified and is not the local queuemanager, then mq is not interested in the queuename (because it is the name of a queue on a different queuemanager) and checks if there is a remoteq (qmgr alias) or xmitq that is named like the objektqmgr name so that mq can route the message (i leave out cluster and other stuff here to make it more simple)
and thats dhe difference. and because amqsput is not using the objectqmgrname it will not work. you can modify the sample to fit your needs.
you may also want to read about name resolution in the application programmers guide. _________________ Regards, Butcher |
|
Back to top |
|
 |
mqmhr |
Posted: Fri Jan 13, 2006 12:53 am Post subject: |
|
|
Centurion
Joined: 28 Dec 2004 Posts: 105
|
In the object descriptor of the MQOPEN call inside amqsput, specify "QM2" as the ObjectQMgrName. "QL.TEST" will be taken as the ObjectName when you specify it as a parameter for amqsput. Run the program as "amqsput QL.TEST QM1" so that it will use QM1 for the MQCONN. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 13, 2006 4:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Use the API exerciser from the first steps. Make sure the advanced mode is checked.
You should now be able to connect to QM1 and create the right information in the MQMD to put your message to QM2 QL.TEST.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|