tags:

views:

21

answers:

1

Hi

I have a Web App and a service sitting on the same machine and communicating via message queues. The problem I'm experiencing is that about half of the time the messages I send from the service are not arriving to the reading code in the web app. Some of them will arrive and some will not. The messages are sent with at least 1 second delay between them.

To make things harder - I don't see ANY of my messages in the management console, even those that do arrive. I turned journaling on, but see no difference. I have full access to the queue.

I'm new to MSMQ and suppose it is something small I miss, but from reading online I could not figure it out.

The reading code looks like this:

public SomeMethod
{
 ...
    MessageQueue respQ = Utils.GetResponseQueue();
    respQ.Formatter = new XmlMessageFormatter(new Type[] { typeof(String) });
    respQ.ReceiveCompleted += new ReceiveCompletedEventHandler(OnReceiveCompleted);
    respQ.BeginReceive();
}
public void OnReceiveCompleted(Object source, ReceiveCompletedEventArgs asyncResult)
{
    MessageQueue replyQueue = (MessageQueue)source;
    Message replyMessage = replyQueue.EndReceive(asyncResult.AsyncResult);

    try
    {
          //process the message
          //...

    }
    catch (Exception)
    {
    }

    replyQueue.BeginReceive();
}

Would appreciate help on both missing messages and on messages not appearing in the management console

Moshe