473,413 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Asynchronous Reads from MSMQ

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
}
Mar 5 '08 #1
1 2343
I've had good luck with this helper listener.

http://msmvps.com/blogs/manoj/archiv.../16/70979.aspx

See my comment as well at the bottom for binary formatting.


"Konstantin" <ni****************@hotmail.comwrote in message
news:Oh**************@TK2MSFTNGP05.phx.gbl...
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
}

Mar 5 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Corne Oosthuizen | last post by:
I'm writing a Telnet Server application using Asynchronous sockets. I spawn a listener thread to handel incomming connections and create a separate client socket for each new connection. I...
2
by: Leo | last post by:
Version 7 fixpack 9, aix 5.1 In our database we have a table that that has a dedicated bufferpool for the data, and another for indexes. Actually we have three of these combinations and they...
1
by: Ollie Riches | last post by:
I am trying to use asynchronous logging using MSMQ and I have configured the properties as defined in the help (see below) I don't understand where the property 'MsmqPath' is in the app.config for...
8
by: TC | last post by:
Hello, I am making an asynchronous call to a webservice and trying to update the web page with the results. The page is not updating. Does anybody know why??? Below is my code:
4
by: 6954 | last post by:
Hi! i need to implement some asynchronous call to my com+ component, but i need it to return some values (e.g. results of sql select statement). obviously queued components and MSMQ are out of...
3
by: =?Utf-8?B?Q0xFQVItUkNJQw==?= | last post by:
We have an asp.net application that will also use MSMQ. When a client makes a request, we want to check several databases and put each response in MSMQ. We don't want the client to wait for all...
2
by: =?Utf-8?B?Q0xFQVItUkNJQw==?= | last post by:
We have an asp.net application that will also use MSMQ. When a client makes a request, we want to check several databases and put each response in MSMQ. We don't want the client to wait for all...
6
by: Pat B | last post by:
Hi, I'm writing my own implementation of the Gnutella P2P protocol using C#. I have implemented it using BeginReceive and EndReceive calls so as not to block when waiting for data from the...
1
by: Florence Tissot | last post by:
We are seeing some kind of resource leak in our performance lab running an ASP.NET (2.0) application that sends and receives messages from 2 public MSMQ queues. Here's a brief summary of what are...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.