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)
.