tags:

views:

1139

answers:

3

Hi

Is it possible to delete a single message from a MSMQ message queue ? I have a Queue object, a message (object) that I have got to by peeking and the ID of the message, I can see a way of deleting (or purging) the entire queue, but I can't see a way to delete the message on it's own, I've tried receiving the message once I have found it by peeking, but I get the error that "the cursor is invalid"

Any help gratefully received

A: 

You could try QueueExplorer.

Abtin Forouzandeh
Thanks but I want to do it programatically
spacemonkeys
+2  A: 

Are you trying to use MessageQueue.ReceiveById?

Abtin Forouzandeh
Damn .. I was trying to be to clever and recieve by my peek cursor on the queue .... recieveById worked just fine .. ta
spacemonkeys
A: 

Use one of the receive function. Depending on your language/technology ( c, com, .net ).

For .net it will be the MessageQueue.ReceiveById Method. Or any that you find appropriate. Depending on the message you want to remover (first, last, using cursor or id ).

Igal Serban