Use the dmpmqmsg utility between two systems

The dmpmqmsg utility (formerly qload) has been incorporated into the product from Version 8.0. Formerly the utility has been available as SupportPac MO03.


Overview

The dmpmqmsg utility allows you to copy or move the contents of a queue, or its messages, to a file. This file can be saved away as required and used at some later point to reload the messages back onto the queue. Important: The file has a specific format understood by the utility. However, the file is human-readable, so that we can update it in an editor before you reload it. If you do edit the file we must not change its format. Possible uses are:

  • Saving the messages that are on a queue, to a file. Possibly for archiving purposes, and later reload back to a queue.
  • Reloading a queue with messages you previously saved to a file.
  • Removing old messages from a queue.
  • 'Replaying' test messages from a stored location, even maintaining the correct time between the messages if required.

Attention: SupportPac MO03 used the -l parameter for specifying local or client binding. -l has been replaced by the -c parameter.

-P is now used for code page information instead of -c.

See dmpmqmsg for further information on the command and the available parameters.


Example of using the dmpmqmsg utility on Linux, using a Windows machine

We have a queue manager on a Linux machine that has messages on a queue (Q1) that we want to move into another queue ( Q2) in the same queue manager. You want to initiate the dmpmqmsg utility from a Windows machine.

Queue (Q1) has four messages that have been added by using the sample amqsput (local queue manager) or amqsputc (remote queue manager) application.

On the Linux machine you see:
display ql(Q1) CURDEPTH
        2 : display ql(Q1) CURDEPTH
AMQ8409: Display Queue details.
     QUEUE(Q1)                                             
TYPE(QLOCAL)
     CURDEPTH(4)
Set the MQSERVER environment variable to point to the queue manager in Linux. For example:
set MQSERVER=SYSTEM.DEF.SVRCONN/TCP/veracruz.x.com(1414)
where veracruz is the name of the machine.

Run the dmpmqmsg utility to read from the queue, Q1, and store the output in c:\temp\mqqload.txt.

Connect as a remote client to the queue manager, QM_VER, running in the Linux host and port established by MQSERVER. You achieve the connection as a remote client by using the attribute: -c.
dmpmqmsg -m QM_VER -i Q1 -f c:\temp\mqqload.txt -c
Read      - Files:    0   Messages:       4   Bytes:            22
Written - Files:    1   Messages:       4   Bytes:            22

The output file c:\temp\mqqload.txt contains text, using a format that the dmpmqmsg utility understands.

On the Windows machine, issue the dmpmqmsg command (using the -o option instead of the -i option) to load queue (Q2) on the Linux machine from a file on the Windows machine:

dmpmqmsg -m QM_VER -o Q2 -f c:\temp\mqqload.txt -c
Read      - Files:    1   Messages:       4   Bytes:            22
Written - Files:    0   Messages:       4   Bytes:            22

On the Linux machine, note that there are now four messages in the queue that have been restored from the file.

display ql(Q2) CURDEPTH
        6 : display ql(Q2) CURDEPTH
AMQ8409: Display Queue details.
     QUEUE(Q2)                                             
TYPE(QLOCAL)
     CURDEPTH(4)

On the Linux machine,

Delete the messages from the original queue.
clear qlocal(Q1)
        4 : clear qlocal(Q1)
AMQ8022: IBM MQ queue cleared.
Confirm that there are no more messages on the original queue:
display ql(Q1) CURDEPTH
        5 : display ql(Q1) CURDEPTH
AMQ8409: Display Queue details.
     QUEUE(Q1)                                             
TYPE(QLOCAL)
     CURDEPTH(0)

See dmpmqmsg for a description of the command and its parameters.

Parent topic: Work with local IBM MQ objects


Related concepts