+

Search Tips | Advanced Search

Use the dmpmqmsg utility between two systems

The dmpmqmsg utility (formerly qload) is incorporated into the product from Version 8.0. Formerly the qload 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 we do edit the file you must not change its format. Possible uses are:

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

You have a queue manager on a Linux machine that has messages on a queue (Q1) 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.