Oops, sorry, I sent the previous message before I
finished it by mistake.
Let's recapitulate:
Well, what I'm about to detail is not really a problem,
but something you should be aware of.
If you read the messages from the Q using BeginReceive,
you may end up receiving one more message than you
intended. Imagine you are using the following scheme:
void init()
{
queue.ReceiveCompleted += new
ReceiveCompletedEventHandler(receiveCompleted);
queue.ReceiveCompleted -= new
ReceiveCompletedEventHandler(receiveCompleted);
}
Well, after the call to stopReceivingMessages() there is
still one message you will get (unless you close the Q
of course)...
There's an important principle to follow in developing
MSMQ applications: Send to remote queues, receive from
local queues.
Unfortunately, the 'receive from local queues' is not
always possible. We are building a smart client app with
the users being disconnected most of the time.
And we don't want to use AD for routing so I don't see
any options but to use remote queues for reads. If there
is any better way to approach this, I'd be interested to
know.
Also curious as to whether it makes a significant
difference in having multiple (not shared by huge # of
users) queues or one queue where all remote users peek
and pull off messages.