You can delete all messages from a local queue in the Queue
Statistics workspace.
Remember: If there is uncommitted messages in
the queue, these messages will not be deleted.
Perform the following steps to delete all messages from a
local queue in the Queue Statistics workspace:
- Open the monitoring file of the WebSphere® MQ
Monitoring agent. See Changing monitoring options for information
about how to open the monitoring file on a specific operating system.
- Add the following command to the monitoring file to allow
deletion of messages from the queue:
SET QACCESS NAME(queue_name) MSGACCESS(DELETE) MGRNAME(qmgr_name)
where queue_name is
the name of the queue whose messages you want to delete and qmgr_name is
the name of the queue manager that the queue belongs to.
- Restart the WebSphere MQ
Monitoring agent for the changes
to take effect.
- Click Queue Statistics in the Navigator
physical view to open the Queue Statistics workspace.
- In the Queue Statistics for Monitored Queues
with Messages table, right-click the row that corresponds
to the queue whose messages you want to delete, and click Purge
Queue (MQGET). A message is displayed,
asking if you want to purge all messages from the selected queue.
- Click Yes.
All the messages on the queue are deleted.