You can purge all messages currently queued at a physical destination. Purging a physical destination means that all messages stored at the destination are deleted.
You might want to purge messages when the accumulated messages are taking up too much of the system’s resources. This might happen when a queue does not have registered consumer clients and is receiving many messages. It might also happen if inactive durable subscribers to a topic do not become active. In both cases, messages are held unnecessarily.
To purge messages at a physical destination, use the purge dst subcommand. This is the syntax of the purge dst subcommand:
purge dst -t destType -n destName
imqcmd purge dst -n myQueue -t q -u admin imqcmd purge dst -n myTopic -t t -u admin
imqbrokerd -reset messages -u admin
This saves you the trouble of purging destinations after restarting the broker.
In a broker cluster, instances of the physical destination reside on each broker in the cluster. You must purge each of these destinations individually.