Set up client triggering in WebSphere MQ

Say you want to run a script on a remote machine when the queue is on the server machine. One solution here is to use a client trigger. This means that you run a client trigger monitor on the remote machine. When something lands on the queue on the server the client trigger monitor will run the script on the remote machine. Here is how I set it up

On server:(MQ server installed and configured)

  1. Create a new client channel with chltype(SVRCONN)
  2. Create a new init queue (standard options) – every remote machine needs their own initqueue
  3. Create a process with applicid as it would be if you run the command on the REMOTE machine
  4. Create a new queue with the new init queue and process attached

On the client machine (MQ client installed and configured):

  1. Set the MQSERVER environment variable. Syntax: MQSERVER=’client channel/protocol/adress to server(port)’, eg MQSERVER=’MY.CLIENT.CHANNEL/TCP/192.168.0.1(1414)
  2. Check that the remote machine can talk to the server
  3. Start the client trigger monitor ‘runmqtmc -m <qmanager> -q <init queue name>’
    • qmanager – the same you made your new queue on
    • init queue name – the init queue to be used
  4. Done!

Now enable trigger on the queue and watch the magic when messages are pouring in.

Tested on RHEL 3 and WebSphere MQ 5.3

Comments are closed.