How To Remove the First Message from a MQ Queue on Windows

If your queue manage is running on Windows and you have a queue with some messages but you want to remove the first message from that queue which due to some reason not getting process and holding up other messages in turn.


There are few ways to remove that message.


Use RFHUTIL 

1.1 Download RFHUTIL from here http://www-01.ibm.com/support/docview.wss?uid=swg24000637

Open that link and go to the below section on the page



Click and HTTP and follow the instruction and unzip the file into you local drive.




1.2 Open the rfhutil.exe if your queue manage is running on your local system or go to step 2.1

1.3 Load Queue manager name & then queue namge
1.4 Clock on Browse once.
1.5 Now you have the first message loaded on your rfhtuil
1.6 Clock on READ now - make sure you click only once. and wait for the response
1.7 on response now you have cleared your first message from the queue.

2.1  if you have queue manager running on some other machine , use the rfhutilc.exe
2.2 follow the instruction here till step 4 only on this link - https://developer.ibm.com/answers/questions/397554/how-do-you-set-up-and-use-rfhutilcexe-to-connect-t/
2.3 now you are connected with your queue manage running on remote and loaded the queue as well now follow the step 1.5 to 1.7 mentioned above.

And you are done.


Use Qload

1.1 Download Qload from here http://www-01.ibm.com/support/docview.wss?uid=swg24009368

Open that link and go to the below section on the page

Click and HTTP and follow the instruction and unzip the file into you local drive.

1.2 Extract this into your local system.
1.3 go to the location from your cmd - C:\mo03\V1.9\Windows
1.4 run the command - qload -m IB9QMGR -I LARGE_MESSAGING_IN -f IB9QMGR.log -r 1
modify the command based on your requirement.  Eg.






As you can above command will clear the first message from queue and put into a file as well.

And you are done here. Thanks.


Feel free to put comment below in of any queries .

Comments