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




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com