IBM Support

Is there a way to delete a single message from an MQ queue (arbitrary position in the queue)?

Question & Answer


Question

Is there a way to delete a single message from an MQ queue (arbitrary position in the queue)?

Answer

Two options are described below.
a) One method to delete a single message is by using the following SupportPac in an MQ Explorer in Windows or in Linux x86 that can remotely connect to the queue manager in AIX.
.
The following SupportPac MS0P has the feature "Message Manager" that can be used to delete a message, to copy/move it to another queue, or copy it into a file
Download the zip file, and from the pdf file see: Message Manager Plug-in, Page 28
https://www.ibm.com/support/pages/node/712469
MS0P: WebSphere MQ Explorer – Extended Management Plug-ins and Tools
.
WebSphere MQ Explorer plug-in for Events and Statistics reports
Plug-ins
• The original plug-in written for this SupportPac provides a mechanism to format Event messages; it can aggregate the Statistics and Accounting reports generated by MQ from Version 6 onwards.
• There is a plug-in to display current activity on queues and channels as a simple graph.
• The package also implements the "Trace Route" function, reporting on the route that messages take through a network.
• A plug-in to allow information shown in many of the Explorer’s tables, such as the list of queues defined on a queue manager, to be saved to a CSV (comma-separated value) file where it can be processed by programs such as spreadsheets.
*** Another plug-in extends the Message Browser, to allow messages to be deleted, moved to another queue, or written to a file. ***
• A Wizard makes it simple to define connections between two queue managers.
• The topic objects defined on a queue manager can be displayed in a tree structure, to make it easier to see the relationships between them.
• Queue Manager configurations can be extracted using the dmpmqcfg command. This is accessible via the Remote Admin plug-in for queue managers at V7.1 or later, or via the main list of queue managers in the Explorer tree, if the dmpmqcfg command is part of that Explorer installation.

b) There is another SupportPac that is a command line interface that if you know the messageid of the message that you want to delete from the queue (for example, obtained from amqsbcg, the MQ sample to browse a queue), then you can delete that message.
Example:
To do a destructive get, use -IQ1 (where Q1 is the name of the queue).
q -IQ1 -mQMgr -gxm414D5120514D5F373031202020202020D49F695020001D05
 
+++ end +++

[{"Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"ARM Category":[{"code":"a8m0z00000008ObAAI","label":"Components and Features->Administration"}],"ARM Case Number":"TS004883981","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Document Information

Modified date:
22 February 2021

UID

ibm16416577