2
votes

I have setup MQ7.0 On three system: A, B and C. A -> B there is sender-receiver channel (A.B) and B->C, there is sender-receiver channel(B.C). Transmission queue names are same.Name of queue managers as QMA,QMB and QMC respectively. Now I have a queue QC on system C. I have defined a remote queue definition on system A as: define qremote(RQ) rname(QC) rqmname(third) xmitq(A.B)

I have a define remote queue mgr definition on system B as: define qremote(third) rname('') rqmname(QMC) xmitq(B.C)

now what I expected when I put a message to remote queue RQ on A, it should travel to system B with transmission header "QC on third" through channel on tx queue(A.B)..on system B since third is aliased as QMC so this message should be put to tx B.C and should reach Queue QC on system C. But after I put message, it is lost. Is my understanding wrong about remote queue mgr alias. Can someone give better example.

1

1 Answers

1
votes

Try this:

On QMA

DEF QR(QMC) RQMNAME(' ')   RNAME(' ') XMITQ(QMB)
DEF QR(QC)  RQMNAME('QMC') RNAME(' ') XMITQ('QMB')
DEF QL(QMB) USAGE(XMITQ) TRIGTYPE(FIRST) TRIGGER
* Channel def goes here

The QRemote is a QMgr alias. It specifies the path to QMC goes through the QMB XMitQ. Once this is defined, anything destined for QMC will resolve to the QMB XMitQ. The blank RNAME and RQMNAME is what makes this a QMgr alias and not a classic remote queue definition. At this point if you use a tool like the Q program which allows you to specify the QMgr to connect to separately from the QMgr used for the OPEN command, you don't even need a QRemote. ANY mesage destined for QMC will now resolve to QMB.

However, if you wanted to use something less sophisticated like amqsput then you really do need a QRemote. The DEF QR(QC accomplishes this. If you are willing to use QRemotes then you don't really need the QMgr alias. This just says "If someone opens a queue named QC then address it to QC on QMC and put it on the QMB XMitQ.

On QMB

DEF QL(QMC) USAGE(XMITQ) TRIGTYPE(FIRST) TRIGGER
* Channel def goes here

On QMB when the mssages arrive addressed to QMC, they will automatically resolve to the XMitQ without any further definitions or guidance.

On QMC

DEF QL(QC)

Finally, the messages arrive on QMC addressed to QC so you need a QLocal for them to land in.

Name resolution is a bit complicated but once you understand it, you pretty much understand WMQ addressing. I'd recommend sitting down with the Name Resolution Infocenter topic and reconciling back to the behavior you are seeing.

By the way, the discrepancy in your definitions appears to be that your QRemote used the name of the channel instead of the XMitQ. At one point you say "Transmission queue names are same.Name of queue managers as QMA,QMB and QMC respectively." So I expect on B to find an XMitQ named QMC serving the QMB.QMC channel. But later you define the QMgr alias as define qremote(third) rname('') rqmname(QMC) xmitq(B.C) which should be XMITQ(QMC).