Search code examples
queuemessage-queueibm-mqmq

Whats the difference between using the clear command and mqget api call to clear a queue?


While clearing the queue in WebSphere MQ, whats the difference between using the clear command and mqget API call ?


Solution

  • I just verified that the CLEAR command also reduces the size of the queue file back to that of any empty queue.

    With Clear QL, WMQ discards the queue file as well and recreates it. Normally, a queue file's size is not reduced until after some interval of the file space not being used.

    I remember having to do this when we had a queue fill up the disk. rather than process the messages, we CLEARed the queue to free up the disk space at the same time.