.NETGURU
MSMQ
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-messaging' list.


Ahmed, Salman
Alex!
Can't you use the messageQeue.Receive method and put a really long
timeout on it? Maybe create a console app that keeps waiting for messages
to enter the queue..or is this a hack?

Reply to this message...
 
    
Wally McClure
I would suggest using the BeginReceive method and perform your message queue
receives asychronously. I have a service that does this and works very
well.

Wally

-----Original Message-----
From: Ahmed, Salman [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 9:42 AM
To: ngfx-messaging
Subject: [ngfx-messaging] MSMQ

Alex!
Can't you use the messageQeue.Receive method and put a really long
timeout on it? Maybe create a console app that keeps waiting for messages
to enter the queue..or is this a hack?

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

Reply to this message...
 
    
Ahmed, Salman
that's exactly what I have almost working :P

Send your code if u dont' mind? :P

-----Original Message-----
From: Wally McClure [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 10:18 AM
To: ngfx-messaging
Subject: [ngfx-messaging] RE: MSMQ

I would suggest using the BeginReceive method and perform your message queue
receives asychronously. I have a service that does this and works very
well.

Wally

-----Original Message-----
From: Ahmed, Salman [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 9:42 AM
To: ngfx-messaging
Subject: [ngfx-messaging] MSMQ

Alex!
Can't you use the messageQeue.Receive method and put a really long
timeout on it? Maybe create a console app that keeps waiting for messages
to enter the queue..or is this a hack?

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

Reply to this message...
 
    
Wally McClure
Here is the basics of my code. It is in c#.

        protected override void OnStart(string[] strArgs)
        {
//do a bunch of setup stuff.
            gMQ = new MessageQueue();
            gMQ.Path = gstrQueue;
            gMQ.Formatter = new XmlMessageFormatter(new
string[]{"System.String, mscorlib"});
            gMQ.ReceiveCompleted += new
ReceiveCompletedEventHandler(this.MQ_ReceiveCompleted );
            gMQ.BeginReceive();
        }

        private void MQ_ReceiveCompleted(object sender,
ReceiveCompletedEventArgs e)
        {
            // Add code here to respond to message.
            Message msg = gMQ.EndReceive(e.AsyncResult);
            msg.Formatter = new XmlMessageFormatter(new
String[]{"System.String, mscorlib"}); //new XmlMessageFormatter(new
String(){"System.String, mscorlib"});
            string strBody = (string)msg.Body;
            try
            {
//Process the message as needed
            }
//Exception handling code
            finally
            {
                gMQ.BeginReceive();
            }

        }

-----Original Message-----
From: Ahmed, Salman [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 10:41 AM
To: ngfx-messaging
Subject: [ngfx-messaging] RE: MSMQ

that's exactly what I have almost working :P

Send your code if u dont' mind? :P

-----Original Message-----
From: Wally McClure [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 10:18 AM
To: ngfx-messaging
Subject: [ngfx-messaging] RE: MSMQ

I would suggest using the BeginReceive method and perform your message queue
receives asychronously. I have a service that does this and works very
well.

Wally

-----Original Message-----
From: Ahmed, Salman [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 9:42 AM
To: ngfx-messaging
Subject: [ngfx-messaging] MSMQ

Alex!
Can't you use the messageQeue.Receive method and put a really long
timeout on it? Maybe create a console app that keeps waiting for messages
to enter the queue..or is this a hack?

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

Reply to this message...
 
    
Ahmed, Salman
Thanks!
That is very similar to what I have already, a MSDN article has code very
close to that. Mine is console application that will make a Connection to
the page that will collect the message of the queue via. "ASPTear" (but not
ASPTear).

Thanks again.

-----Original Message-----
From: Wally McClure [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 1:08 PM
To: ngfx-messaging
Subject: [ngfx-messaging] RE: MSMQ

Here is the basics of my code. It is in c#.

        protected override void OnStart(string[] strArgs)
        {
//do a bunch of setup stuff.
            gMQ = new MessageQueue();
            gMQ.Path = gstrQueue;
            gMQ.Formatter = new XmlMessageFormatter(new
string[]{"System.String, mscorlib"});
            gMQ.ReceiveCompleted += new
ReceiveCompletedEventHandler(this.MQ_ReceiveCompleted );
            gMQ.BeginReceive();
        }

        private void MQ_ReceiveCompleted(object sender,
ReceiveCompletedEventArgs e)
        {
            // Add code here to respond to message.
            Message msg = gMQ.EndReceive(e.AsyncResult);
            msg.Formatter = new XmlMessageFormatter(new
String[]{"System.String, mscorlib"}); //new XmlMessageFormatter(new
String(){"System.String, mscorlib"});
            string strBody = (string)msg.Body;
            try
            {
//Process the message as needed
            }
//Exception handling code
            finally
            {
                gMQ.BeginReceive();
            }

        }

-----Original Message-----
From: Ahmed, Salman [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 10:41 AM
To: ngfx-messaging
Subject: [ngfx-messaging] RE: MSMQ

that's exactly what I have almost working :P

Send your code if u dont' mind? :P

-----Original Message-----
From: Wally McClure [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 10:18 AM
To: ngfx-messaging
Subject: [ngfx-messaging] RE: MSMQ

I would suggest using the BeginReceive method and perform your message queue
receives asychronously. I have a service that does this and works very
well.

Wally

-----Original Message-----
From: Ahmed, Salman [mailto:Click here to reveal e-mail address]
Sent: Tuesday, March 12, 2002 9:42 AM
To: ngfx-messaging
Subject: [ngfx-messaging] MSMQ

Alex!
Can't you use the messageQeue.Receive method and put a really long
timeout on it? Maybe create a console app that keeps waiting for messages
to enter the queue..or is this a hack?

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

| [ngfx-messaging] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-messaging.asp = JOIN/QUIT

Reply to this message...
 
 
System.Messaging.MessageQueue
System.Messaging.ReceiveCompletedEventArgs
System.Messaging.ReceiveCompletedEventHandler
System.Messaging.XmlMessageFormatter
System.String




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification