PROPID_Q_BASEPRIORITY

Optional. The PROPID_Q_BASEPRIORITY property specifies a single base priority for all messages sent to a public queue.

Type Indicator
VT_I2
PROPVARIANT Field
iVal
Property Values
Integer value between -32768 and +32767 (the default is 0).

Remarks

A public queue's base priority is used for routing the queue's messages over the network. It can be used to give the messages sent to the queue a higher (or lower) priority than messages sent to other queues. For example, when a queue's base priority is set, all the messages sent to it are given a higher priority than messages sent to queues with a lower base priority. The queue's base priority has no effect on the order of the messages in the queue or how messages are read from the queue.

PROPID_Q_BASEPRIORITY applies only to public queues that can be located through Active Directory (using a public format name). The base priority of private queues, as well as public queues accessed directly, is always 0.

MSMQ combines the queue's base priority with the message's priority (PROPID_M_PRIORITY) to determine the overall priority of a message when it is sent to the queue.

To set the initial base priority of a public queue, specify PROPID_Q_BASEPRIORITY in the MQQUEUEPROPS structure and call MQCreateQueue.

To change the base priority of a public queue, specify PROPID_Q_BASEPRIORITY in the MQQUEUEPROPS structure and call MQSetQueueProperties.

To retrieve the base priority of a queue, specify PROPID_Q_BASEPRIORITY in the MQUEUEPROPS structure and call MQGetQueueProperties and examine its returned value.

Example

This example shows how PROPID_Q_BASEPRIORITY is specified in the MQQUEUEPROPS structure for both setting and retrieving the queue's priority level.

//To set the priority level
aPropID[I] = PROPID_Q_BASEPRIORITY;    // Property identifier
aVariant[I].vt = VT_I2;                // Type indicator
aVariant[I].iVal = 1000;               // Priority level of queue
I++

//To retrieve the priority level
aPropID[I] = PROPID_Q_BASEPRIORITY;   // Property identifier
aVariant[I].vt = VT_I2;               // Type indicator
i++
For complete examples of… See…
Creating a public or private queue Creating a Queue
Retrieving the priority level of the queue Retrieving PROPID_Q_BASEPRIORITY

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mq.h.
  Import Library: Use mqrt.lib.
  Unicode: Defined only as Unicode.

See Also

MQCreateQueue, MQGetQueueProperties, MQSetQueueProperties, PROPID_M_PRIORITY