Ayende @ Rahien

It's a girl

MessageQueue trouble continues

I mentioned that I got into some problems with MSMQ that I couldn’t reproduce later on. Well, here is the actual code that I am running that is causing a hung. As you can see, this is really strange.

image

Comments

Kim
01/25/2009 01:25 AM by
Kim

With identical code I get

test_queue2

CompletedSynchronously: False

IsCompleted: False

Wait completed : False

test_queue

CompletedSynchronously: False

IsCompleted: False

Wait completed : False

Kim
01/25/2009 01:30 AM by
Kim

sorry, missed to the comment about "messages in queue2". Too late... Same result as you.

configurator
01/25/2009 02:50 PM by
configurator

Erm, according to MSDN,

BeginPeek() Initiates an asynchronous peek operation that has no time-out. The operation is not complete until a message becomes available in the queue.

So when there are no messages, the peek would never complete. What am I missing?

Anon
01/25/2009 08:44 PM by
Anon

It's not good practice to reuse an object after it's disposed, right? I'm sure examples like this exist all over the BCL; especially cases where one is using BeginXXX after disposal.

Michael McDaniel
01/26/2009 03:35 PM by
Michael McDaniel

I also had weird problems with MSMQ, but the problems only happened when I was using the async functions/events. I found them to be pretty unreliable - especially when failures occured. Things would just stop working - no reason, no exception, the thread would simply die. It was so inconsistent, that I ended up just polling on my own threads.

Comments have been closed on this topic.