Search code examples
ibm-mq

Is it possible to setup an IBM MQ reciever channel to recieve messages from two different queue managers


Is it possible to setup an IBM MQ receiver channel to receive messages from two different queue managers with the sender channels named identically. I am looking at a situation where a client wishes to have two queue managers (A and B) able to send messages to the same destination queue manager (C). A and B are setup up in an active / passive cluster setup without shared storage.


Solution

  • It is not only possible to set up IBM MQ Receiver channels to receive messages from two different queue managers, it is recommended to do so.

    For example, on QM3 (the receiving queue manager) make the following definition:

    DEFINE CHANNEL(TO.QM3) CHLTYPE(RCVR) TRPTYPE(TCP)
    

    Then on both QM1 and QM2 make the following definitions:

    DEFINE CHANNEL(TO.QM3) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('qm3-host-name(qm3-port)') XMITQ(QM3)
    DEFINE QLOCAL(QM3) USAGE(XMITQ)
    

    Doing this will NOT cause sequence number issues as the state for each running receiver channel instance is keyed off the channel name plus the partner queue manager name, so there will be state for:-

    • Channel:TO.QM3 from Partner QMgr QM1
    • Channel:TO.QM3 from Partner QMgr QM2

    Both channel instances can be running at the same time quite happily without interfering with each other.

    You can see this state by issuing the following command on the receiving queue manager, QM3:-

    DISPLAY CHSTATUS(TO.QM3)