K
Konstantin
Hello,
I am implementing an asynchronous message processing using MSMQ. Since I
want to process more than one message at a time BeginReceive is getting
called within the event handler. The application seems to start hanging at
the method that does the processing. The snippet below shows in a nutshell
what I am trying to do. MessageParser object is created successfully but the
ProcessMessage method is never called. Any ideas about what I am doing
wrong are greatly appreciated.
private void OnReceiveCompleted(object sender, ReceiveCompletedEventArgs e)
{
Message msg = _queue.EndReceive(e.AsyncResult);
_queue.BeginReceive();
MessageParser mp = new MessageParser(msg);
mp.ProcessMessage(); ///Stalls here
}
I am implementing an asynchronous message processing using MSMQ. Since I
want to process more than one message at a time BeginReceive is getting
called within the event handler. The application seems to start hanging at
the method that does the processing. The snippet below shows in a nutshell
what I am trying to do. MessageParser object is created successfully but the
ProcessMessage method is never called. Any ideas about what I am doing
wrong are greatly appreciated.
private void OnReceiveCompleted(object sender, ReceiveCompletedEventArgs e)
{
Message msg = _queue.EndReceive(e.AsyncResult);
_queue.BeginReceive();
MessageParser mp = new MessageParser(msg);
mp.ProcessMessage(); ///Stalls here
}