Hi,
I have a problem with a C# app using MSMQ. The problem has just started occurring in the last week or so. It is happening on both an existing PC and a newly installed PC, both are running XP Pro - the problem does not appear to occur in W2k3 server.
The setup is this;
I have a w2k3 server running a windows service which listens to several message queues for requests, and sends repsonses to clients. The two clients are XP pro and running a C# WinForms client. All of the PC's have MSMQ installed, but without active directory integration, and they're using private queue names (either direct=tcp:<address>\private$\blah or direct=oscname\private$\blah).
All of this has been working fine until this week. When I tried it this week, using a new PC, or the existing PC with a new queue name, I no longer received the responses from the server. The specific symptoms are;
1. Server receives the request, and my logging to the event log says a response was sent.
2. There is no message in queue on the sending PC (although the outgoing queue exists).
3. The message does not appear in the receiving queue on the client PC, and my client app never says it go the message.
4. If I send the request and ask the server to send the response to a non-existent IP, then the outgoing queue on the server (to the non-existent pc) gets created, and the message is shown waiting in the queue, so I am sure the server is sending it.
Note, this is very disturbing, since MSMQ seems to be just losing the message completely, and silently, which it isn't ever supposed to do
Anyway.. after much trial and error I have narrowed down the problem to the fact that the program is creating the queue for me. If I manually create the queue using the MSMQ snap-in, it works, if my software creates the queue for me, it doesn't (symptoms as above). Weirdly, I have completed the properties of both queue (using the property dialog in the MMC snap-in) for a self-created queue and an client-created queue, and the properties are all exactly the same, yet one works and the other doesn't.
My software has been creating it's own queues for months, without any problems, and now this - even on a clean install of XP (Sp2 - with all windows updates applied). I am kinda of suspecting a windows update or something has caused the problem.
Anyone got any other ideas, or know of a specific problem with a windows update etc
Thanks.
PS: While not exactly my actual code, here is a code sample to create the queue, which does cause the problem I'm talking about;
private MessageQueue CreateQueue(string path)
{
if (!MessageQueue.Exists(path)) MessageQueue.Create(path, false); MessageQueue queue = new MessageQueue(path, QueueAccessMode.SendAndReceive); try{
queue.SetPermissions(
"Everyone", MessageQueueAccessRights.FullControl, AccessControlEntryType.Allow);}
catch (Exception e){
Globals.Log.WriteLine(this, EventSeverity.Error, String.Format("Error {0} setting queue permissions for 'Everyone' on queue; {1}.", e.ToString(), path));}
SetQueueProperties(queue);
return queue;}
//End of CreateQueue method.private void SetQueueProperties(MessageQueue queue)
{
queue.Authenticate =
false;queue.EncryptionRequired =
EncryptionRequired.None;queue.Formatter = m_MessageFormatter;
queue.DefaultPropertiesToSend = m_DefaultSendProperties;
}
//End of SetQueueProperties method.