IBM Support

Using IBM MQ dmpmqmsg to delete only the first message from a queue

Question & Answer


Question

The IBM MQ utility "dmpmqmsg" can do many tasks, and one of them is to delete only 1 message (or to move that message to another queue for later processing) but keep intact the other messages in the queue.

Answer

An example to delete the 1st message from queue Q1 and create an output file with the contents of that message (in the format used by dmpmqmsg) is:
  dmpmqmsg -m QM93WIN -I Q1 -r 1 -f deleted-message-1.txt

An example to MOVE the 1st message from Q1 to Q2 is:
  dmpmqmsg -m QM93WIN -I Q1 -o Q2 -r 1
+ For a more detailed scenario see the attached PDF file:
+ tags: 
Author: Angel Rivera;
+++ end +++

[{"Type":"MASTER","Line of Business":{"code":"LOB67","label":"IT Automation \u0026 App Modernization"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"ARM Category":[{"code":"a8m3p000000PCH0AAO","label":"Administration"}],"ARM Case Number":"TS015877299","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
15 April 2024

UID

ibm17148300