Using the dmpmqmsg utility between two systems
The dmpmqmsg utility (formerly qload) is incorporated into the product from IBM® MQ 8.0. Formerly the qload utility has been available as SupportPac MO03.
Overview
- 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.
-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) that you 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.
display ql(Q1) CURDEPTH
2 : display ql(Q1) CURDEPTH
AMQ8409: Display Queue details.
QUEUE(Q1)
TYPE(QLOCAL)
CURDEPTH(4)
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.
-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,
clear qlocal(Q1)
4 : clear qlocal(Q1)
AMQ8022: IBM MQ queue cleared.
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.