Websphere MQ – Copy messages between queues

luca 22/02/2017 0

If you administer a Websphere MQ server, it may happen that someone ask you to manage the messages: create a backup, move messages from a queue to another one…

The main administration tool for WMQ, MQ Explorer, doesn’t support those operations; you can only browse the queues or send test messages:

qload-01

I recently discovered a tool, freely released by IBM, named qload.  This tool allows to move/copy messages between queues or transfer them between a queue and a text file.

qload’s source code is available on Github, in the ibm-messaging repository.

Let’s see some examples of its usage:

  • move all the messages from queue IN.QUEUE to queue OUT.QUEUE, qmanager QM.TEST
./qload -m QM.TEXT -I IN.QUEUE -o OUT.QUEUE
  • copy all the messages from queue IN.QUEUE to queue OUT.QUEUE,qmanager QM.TEST
./qload -m QM.TEXT -i IN.QUEUE -o OUT.QUEUE
  • save all the messages in queue IN.QUEUE, qmanager QM.TEST, to the file msgs.txt
./qload -m QM.TEXT -i IN.QUEUE -f msgs.txt
  • load all the messages from file msgs.txt to queue IN.QUEUE,qmanager QM.TEST
./qload -m QM.TEXT -o IN.QUEUE -f msgs.txt

It’s of course possible to filter the messages. For example the parameter -r allows to specify the number of the message or the range of messages to be included in the action:

./qload -m QM.TEXT -i IN.QUEUE -f msgs.txt -r 10..15

saves in the file msgs.txt only messages with index between 10 and 15.

Leave A Response »

This website uses cookies to ensure you get the best experience on our website maggiori informazioni

Questo sito utilizza i cookie per fonire la migliore esperienza di navigazione possibile. Continuando a utilizzare questo sito senza modificare le impostazioni dei cookie o clicchi su "Accetta" permetti al loro utilizzo.

Chiudi