Working as an MQ administrator, you may often have to copy the messages from one queue to another queue for troubleshooting.
Use dmpmqmsg to copy MQ message
Copying messages from one queue to another is possible with an inbuilt program called
dmpmqmsg in IBM MQ8. In this article, I will explain how to do so.
Scenario – copy a message from LOCAL.Q1 to LOCAL.Q2 in CHANDAN.QMGR
I have one message in LOCAL.Q1 now
dis ql(LOCAL.Q1) curdepth 1 : dis ql(LOCAL.Q1) curdepth AMQ8409: Display Queue details. QUEUE(LOCAL.Q1) TYPE(QLOCAL) CURDEPTH(1)
To copy, I will use
dmpmqmsg –m QMGR –i SOURCE.QUEUE –o TARGET.QUEUE
-bash-4.2$ ./dmpmqmsg -m CHANDAN.QMGR -i LOCAL.Q1 -o LOCAL.Q2 5724-H72 (C) Copyright IBM Corp. 1994, 2015. WebSphere MQ Queue Load/Unload Utility Read - Files: 0 Messages: 1 Bytes: 39 Written - Files: 0 Messages: 1 Bytes: 39 -bash-4.2$
The message is copied from LOCAL.Q1 to LOCAL.Q2.
Let’s verify them.
dis ql(LOCAL.Q2) curdepth 1 : dis ql(LOCAL.Q2) curdepth AMQ8409: Display Queue details. QUEUE(LOCAL.Q2) TYPE(QLOCAL) CURDEPTH(1)
So you see the message is copied to LOCAL.Q2 now.
More great readings on WebSphere
What is Thread Dump and How to Analyze them?Asad Ali on June 29, 2020
IBM WebSphere Application Server Beginner’s GuideChandan Kumar on June 9, 2022
How to Monitor IBM WebSphere using Application Manager?Chandan Kumar on June 9, 2022
How to Use Nginx with WebSphere Application Server?Chandan Kumar on June 9, 2022
How to Create Cluster in IBM WebSphere ND?Chandan Kumar on June 9, 2022
What’s New in WebSphere MQ 9 & Installation GuideChandan Kumar on June 10, 2022
Join Geekflare Newsletter
Every week we share trending articles and tools in our newsletter. More than 10,000 people enjoy reading, and you will love it too.