Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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 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 MQMSGPROPSstructure and call MQSendMessage.

To determine the priority of a message in the queue, specify PROPID_M_PRIORITY in the MQMSGPROPSstructure. Then call MQReceiveMessageand 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 MQMSGPROPSstructure.

Copy Code
MsgProps.aPropID[i] = PROPID_M_PRIORITY; 	// Property ID
MsgProps.aPropVar[i].vt = VT_UI1; 			 // Type indicator
MsgProps.aPropVar[i].bVal = 7;
Note:
OS versions prior to 2.12 require the MSMQ add-on pack.

Requirements

Header mq.h
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also