HighTechTalks DotNet Forums  

Message queue in C#: Priority issue

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss Message queue in C#: Priority issue in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
tiger
 
Posts: n/a

Default Message queue in C#: Priority issue - 10-03-2005 , 01:17 AM






Hi,

I have a question on Microsoft Message Queue. How do I give higher priority
to messages and get it process before others. I will like to use the
mechanism supplied by the queue service rather than relying on reading all
the messages and ordering them. Below I have a simple send and receive.

System.Messaging.Message msg = new System.Messaging.Message();
msg.Body=myPayment;
MessageQueue msgQ =new MessageQueue(".\\Private$\\billpay");
msgQ.Send(msg);
msgQ.Formatter = new XmlMessageFormatter(arrTypes);
myPayment=((Payment)msgQ.Receive().Body);

Your assistants will be greatly
appreciated.

ThanksTiger



Reply With Quote
  #2  
Old   
Richard T. Edwards
 
Posts: n/a

Default Re: Message queue in C#: Priority issue - 10-03-2005 , 06:12 AM






Message priority effects how MSMQ handles the message while it is in route,
as well as where the message is placed in the queue.

Higher priority messages are given preference during routing and inserted
toward the front of the queue. Messages with the same priority are placed in
the queue according to their arrival time.

MSMQ sets the priority level of transactional messages to 0:
PROPID_M_PRIORITY is ignored by the transaction.

To set the priority of a message, specify PROPID_M_PRIORITY in the
MQMSGPROPS structure and call MQSendMessage.

To determine the priority of a message in the queue, specify
PROPID_M_PRIORITY in the MQMSGPROPS structure. Then call MQReceiveMessage
and examine its returned value.



hth.

"tiger" <aaa0715 (AT) omega (DOT) uta.edu> wrote

Quote:
Hi,

I have a question on Microsoft Message Queue. How do I give higher
priority
to messages and get it process before others. I will like to use the
mechanism supplied by the queue service rather than relying on reading all
the messages and ordering them. Below I have a simple send and receive.

System.Messaging.Message msg = new System.Messaging.Message();
msg.Body=myPayment;
MessageQueue msgQ =new MessageQueue(".\\Private$\\billpay");
msgQ.Send(msg);
msgQ.Formatter = new XmlMessageFormatter(arrTypes);
myPayment=((Payment)msgQ.Receive().Body);

Your assistants will be greatly
appreciated.

ThanksTiger





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.