PROPID_M_PRIORITY

This property specifies the priority of the message. A low number means low priority.

  • Type Indicator
    VT_UI1 (or VT_NULL)
  • PROPVARIANT Field
    bVal
  • Property Values
    An integer value between 7 and 0 (the default is 3).

Remarks

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 automatically 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. When specifying PROPID_M_PRIORITY, you can set its Type Indicator to VT_NULL. When the Type Indicator is set to VT_NULL, MSMQ sets the VT field to the appropriate type indicator.

Examples

The following example shows how PROPID_M_PRIORITY is specified in the MQMSGPROPS structure.

MsgProps.aPropID[i] = PROPID_M_PRIORITY;          // Property ID
MsgProps.aPropVar[i].vt = VT_UI1;                 // Type indicator
MsgProps.aPropVar[i].bVal = 7;

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later. Versions prior to 2.12 require the MSMQ add-on pack. Mq.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

MQReceiveMessage, MQSendMessage, MQMSGPROPS

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.