Tuesday, April 5, 2011

Delete Single Message MSMQ

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

From stackoverflow
  • You could try QueueExplorer.

    spacemonkeys : Thanks but I want to do it programatically
  • Are you trying to use MessageQueue.ReceiveById?

    spacemonkeys : Damn .. I was trying to be to clever and recieve by my peek cursor on the queue .... recieveById worked just fine .. ta
  • 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 ).

0 comments:

Post a Comment