Partager via


MSMQMessage.Priority (Windows Embedded CE 6.0)

1/6/2010

This property specifies the message's priority. A low number indicates a low priority message.

Syntax

HRESULT get_Priority( 
  long* plPriority 
);
HRESULT put_Priority( 
  long lPriority
);

Parameters

  • plPriority or lPriority
    Integer value between 7 and 0, where 0 indicates a low priority message.

    The default is 3.

Return Value

The following table describes the common return values.

Value Description

S_OK

Success

E_INVALIDARG

One or more arguments are invalid

E_NOTIMPL

The function contains no implementation

E_OUTOFMEMORY

Out of memory

Remarks

Message priority effects how Message Queuing 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.

For example, when routing messages Message Queuing handles messages with a priority of 7 before it handles messages with a priority of 0, When the message is delivered to the destination queue, Message Queuing places the priority 7 messages closer to the front of the queue.

Messages with the same priority are placed in the queue according to their arrival time.

Ee500939.collapse(en-US,WinEmbedded.60).gifMessages sent to public queues

When Message Queuing routes a message to a public queue, the priority level of the message is added to the priority level of the public queue (the priority level of the queue is specified by the MSMQQueueInfo.BasePriority property of the queue). However, the priority level of the queue has no effect on how messages are placed in the queue.

Ee500939.collapse(en-US,WinEmbedded.60).gifMessage priority within transactions

Message Queuing sets the priority level of transactional messages to 0: MSMQMessage.Priority is ignored by the transaction.

Ee500939.collapse(en-US,WinEmbedded.60).gifEquivalent Function Property

When using MSMQ functions, the priority level of a message can be set using PROPID_M_PRIORITY.

Requirements

Header mqoai.h
Library mqoa.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

MSMQMessage
MSMQQueueInfo.BasePriority
PROPID_M_PRIORITY