+

Search Tips | Advanced Search

Adding a remote queue definition to isolate messages sent from a gateway queue manager

Modify the configuration of overlapping clusters that use a gateway queue manager. After the modification messages are transferred to an application from the gateway queue manager without using the same transmission queue or channels as other cluster messages. The solution uses a clustered queue remote definition, and a separate sender channel and transmission queue.


Before starting

Construct the overlapping clusters shown in Client-server application deployed to hub and spoke architecture using IBM MQ clusters in Create two-overlapping clusters with a gateway queue manager by following the steps in that task.


About this task

The solution uses distributed queuing to separate the messages for the Server App application from other message traffic on the gateway queue manager. We must define a clustered remote queue definition on QM1 to divert the messages to a different transmission queue, and a different channel. The remote queue definition must include a reference to the specific transmission queue that stores messages only for Q1 on QM3. In Figure 1, the cluster queue alias Q1A is supplemented by a remote queue definition Q1R, and a transmission queue and sender-channel added.

In this solution, any reply messages are returned using the common SYSTEM.CLUSTER.TRANSMIT.QUEUE.

The advantage of this solution is that it is easy to separate traffic for multiple destination queues on the same queue manager, in the same cluster. The disadvantage of the solution is that we cannot use cluster workload balancing between multiple copies of Q1 on different queue managers. To overcome this disadvantage, see Adding a cluster transmit queue to isolate cluster message traffic sent from a gateway queue manager. You also have to manage the switch from one transmission queue to the other.

Figure 1. Client-server application deployed to hub and spoke cluster architecture using remote queue definitions


Procedure

  1. Create a channel to separate the message traffic for Q1 from the gateway queue manager
    1. Create a sender channel on the gateway queue manager, QM1, to the target queue manager, QM3.
      DEFINE CHANNEL(QM1.QM3.Q1) CHLTYPE(SDR) CONNAME(QM3HostName(1413)) XMITQ(QM3.Q1) REPLACE
      
    2. Create a receiver channel on the target queue manager, QM3.
      DEFINE CHANNEL(QM1.QM3.Q1) CHLTYPE(RCVR) REPLACE
      

  2. Create a transmission queue on the gateway queue manager for message traffic to Q1
    DEFINE QLOCAL(QM3.Q1) USAGE(XMITQ) REPLACE
    START CHANNEL(QM1.QM3.Q1)
    

    Starting the channel that is associated with the transmission queue, associates the transmission queue with the channel. The channel starts automatically, once the transmission queue has been associated with the channel.

  3. Supplement the clustered queue alias definition for Q1 on the gateway queue manager with a clustered remote queue definition.
    DEFINE QREMOTE CLUSNL(ALL) RNAME(Q1) RQMNAME(QM3) XMITQ(QM3.Q1) REPLACE
    


What to do next

Test the configuration by sending a message to Q1 on QM3 from QM2 using the clustered queue remote definition Q1R on the gateway queue manager QM1.

  1. Run the sample program amqsput on QM2 to put a message.
    C:\IBM\MQ>amqsput Q1R QM2
    Sample AMQSPUT0 start
    target queue is Q1R
    Sample request message from QM2 to Q1 using Q1R

    Sample AMQSPUT0 end

  2. Run the sample program amqsget to get the message from Q1 on QM3
    C:\IBM\MQ>amqsget Q1 QM3
    Sample AMQSGET0 start
    message <Sample request message from QM2 to Q1 using Q1R>
    no more messages
    Sample AMQSGET0 end

Parent topic: Create two-overlapping clusters with a gateway queue manager


Related tasks


Related information

Last updated: 2020-10-04