MSMQ

W

William Ryan

I'm starting to play with MSMQ and have a really newbie question...

I can effectively write to my Queue with no problem. However, what event is
raised when something is added to the queue. Currently, I'm polling the
queue to see if it has anything in it and then processing accordingly. But
that seems like an awkward way to handle messages b/c I might interrogate
the queue x number of times when there's nothing in it. If I could just
wake up the client app when anything is added to the queue, it seems like
it'd be much better solution.

Is there a way to do this, namely, for the queue to send a notification that
something has been added or that it has stuff in it?

TIA,

Bill

--
Cordially,

W.G. Ryan
(e-mail address removed)
www.devbuzz.com
www.knowdotnet.com
 
A

Ali Mazaheri [MCAD]

One way is to implement a windows service which incorporates Timer object
for checking the Queue and notifies the other components in case of new
message.
 
W

William Ryan

Ali:

Thanks for the suggestion, that's actually what I have now....I have a
background thread and a timer in it that's doing the polling , and it
definitely works. I was just wondering if the Queue had anything inherent
in it to notify me.


BTW, I noticed you earned the MCAD. I've been thinking about it for a
while...can you recommend any study material?

Thanks again,

Bill
 
R

Rolf Enidsson

If you use .NET Framework (as I suspect so since you post here) you can use
async programming. Look att BeginReceive / EndReceive in the MessageQueue
class. Read more at
http://msdn.microsoft.com/library/d...ml/vbconAsynchronousProcessing.asp?frame=true

In fact, that whole chapter might be interesting for you.
http://msdn.microsoft.com/library/d...Message-BasedFrameworkFeatures.asp?frame=true

Also there is at least one other article about MSMQ and services at
http://msdn.microsoft.com/library/d...en-us/dndotnet/html/csharpmsmq.asp?frame=true
 
W

William Ryan

Thank you.
Rolf Enidsson said:
If you use .NET Framework (as I suspect so since you post here) you can use
async programming. Look att BeginReceive / EndReceive in the MessageQueue
class. Read more at
http://msdn.microsoft.com/library/d...ml/vbconAsynchronousProcessing.asp?frame=true

In fact, that whole chapter might be interesting for you.
http://msdn.microsoft.com/library/d...Message-BasedFrameworkFeatures.asp?frame=true

Also there is at least one other article about MSMQ and services at
http://msdn.microsoft.com/library/d...en-us/dndotnet/html/csharpmsmq.asp?frame=true


event
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top