0

I am contemplating using LINQ to read messages off a queue, like this guy: http://www.sharepoint4arabs.com/AymanElHattab/Lists/Posts/Post.aspx?ID=8

But I'm wondering if this consumes messages from the queue or not.

Ideally I'd like this to just peek at the messages, and leave them there until either formally consumed or entirely purged.

Of course, I could write some test code to try it out, but am under a time crunch.

Thanks for any tips!

TimH
  • 1,012
  • 1
  • 14
  • 24

2 Answers2

4

The thing to look at and remember here is that LINQ (Language Integrated Query) isn't really doing anything special with the MQ in this scenario.

The consuming of the MQ is coming in the normal fashion new MessageQueue(...); and the author is just interacting with the MessageQueue IEnumerable via LINQ.

So LINQ itself will not automatically remove the messages from the queue, unless the behavior is to remove during iteration.

Quintin Robinson
  • 81,193
  • 14
  • 123
  • 132
  • Thanks for the help! I can now confirm that MSMQ does not, in fact, remove messages from the MSMQ. It seems to just peek at them. – TimH Jan 19 '11 at 19:57