Mysterious MSMQ exception

  • Thread starter Thread starter A.Oldemeier
  • Start date Start date
A

A.Oldemeier

Does anyone know what the MSMQ exception "Error occurs when reading from a
queue on a remote computer." means? It is explained nowhere. I get this
exception in the BeginReceive callback and loose(!) every message which
raises this exception. There is only one newsgroup where this exception is
mentioned
http://rotator.juggler.inetinteractive.com/servlet/ajrotator/664/0/viewHTML?
zone=inet&channel=662&dim=13
I use VC2003, standard code to connect and to receive messages, a Windows
2000 machine as queue server and Windows Professional machine as client.
Thanks in advance
Alex
 
Do you have the appropriate permissions to read from the remote queue? I
have successfully read anything from the queue?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
Firstly, you need to setup the queue so that you have Peek and Receive
access on the user account you'll be using to access it. You can do
this by right clicking on the queue in MMC and selecting security.
Also, the reason you're losing messages on an error is because you're
using a Read. Try first Peeking the message and processing it. If the
message is successfully peeked and processed then remove it from the
queue with a Read. This way you never loose a message no matter how
badly you fail. If you need to do multithreaded access this is possible
also using the PeekNextById and ReceiveNextById commands.

Best of luck,

Matt Furnari
 
Back
Top