Bootstrap FreeKB - IBM MQ - Create remote queue using the define qremote command
IBM MQ - Create remote queue using the define qremote command

Updated:   |  IBM MQ articles

If you are not sure what an MQ queue is, check out our Getting Started tutorial.

Remote queues are used as a way to transmit messages between queues on different queue managers. For example, let's say there are two queue manager, one named MANAGER01 and the other MANAGER02 and you want to send the messages in the queue named "a.queue" on MANAGER01 to the queue named "b.queue" on MANAGER02. In this example, the queue named a.queue on MANAGER01 will be a remote queue and the queue named b.queue on MANAGER02 will be a local queue.

 

The queue named "a.queue" on MANAGER01 will need to be set as a remote queue, to create an association between "a.queue" on MANAGER01 and "b.queue" on MANAGER02. Here is how you can create the remote queue named a.queue on the queue manager named MANAGER01, associated to the queue named b.queue on the queue manager named MANAGER02, using the define qremote command. These examples are based on Linux. 

AVOID TROUBLE

When a value is a string and contains one or more white spaces or special characters, the value must be wrapped in quotes. In this example, a.queue and b.queue are wrapped in quotes because of the period character.

echo "define qremote ('a.queue') rname ('b.queue') rqmname(MANAGER02)" | runmqsc MANAGER01

 

The following should be displayed.

AMQ8006I: IBM MQ queue created.

 

You will also need to create a channel that will be used to channel the messages from a.queue on MANAGER01 to b.queue on MANAGER02. The define channel command can be used to create the channel.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 618ddc in the box below so that we can be sure you are a human.