MSMQ gets and removes

Is it possible to delete a message from MSMQ after reading it?

How can get + delete work like an atomic operation?

+4
source share
2 answers

It looks like you want to look into the following message, and then get it after processing is complete.

Message message = Queue.Peek(); Queue.ReceiveById(message.Id); 
+6
source

Do you mean the difference between Receive and Peek in MSMQ?

IMO - the easiest way to ensure atomic operations is to place queue operations in TransactionScope. This can be done with WCF as follows.

http://msdn.microsoft.com/en-us/library/ms789032.aspx

0
source

All Articles