PROPID_Q_QUOTA

Optional. The PROPID_Q_QUOTA property specifies the maximum size (in kilobytes) of the queue.

Type Indicator
VT_UI4
PROPVARIANT Field
ulVal
Property Values
Size (in kilobytes) of the queue. The default is INFINITE.

Remarks

The PROPID_Q_QUOTA property is typically set when calling MQCreateQueue. To set the maximum size when creating the queue, specify PROPID_Q_QUOTA in the MQQUEUEPROPS structure and call MQCreateQueue.

When a queue's quota is reached, a negative acknowledgment message is returned to the administration queue of the sending application to indicate that the queue is full. MSMQ continues to send negative acknowledgments until the cumulative size of messages in the queue drops below the queue's quota.

To change the maximum size of a queue, specify PROPID_Q_QUOTA in the MQQUEUEPROPS structure and call MQSetQueueProperties with the new value. When the queue's quota is changed, the new quota affects only arriving messages; it does not affect messages already in the queue.

To retrieve the maximum size of a queue, specify PROPID_Q_QUOTA in the MQQUEUEPROPS structure and call MQGetQueueProperties and examine its returned value.

Example

This example shows how PROPID_Q_QU0TA is specified in the MQQUEUEPROPS structure for both setting and retrieving the maximum size of the queue.

//To set the maximum size of the queue
aPropID[i] = PROPID_Q_QUOTA;          // Property identifier
aVariant[i].vt = VT_UI4;              // Type indicator
aVariant[i].bVal = 1000;              // Maximum size of the queue
i++

//To retrieve the maximum size of the queue
aPropID[i] = PROPID_Q_QUOTA;          // Property identifier
aVariant[i].vt = VT_UI4;              // Type indicator
i++
 
For complete examples of… See…
Creating a public or private queue Creating a Queue
Retrieving the maximum size of the queue Retrieving PROPID_Q_QUOTA

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