Optional. The Quota property specifies the maximum size (in kilobytes) of the queue.
Type: | Long |
Run time: | read/write |
object.Quota
Syntax Element | Description |
---|---|
object | Queue information (MSMQQueueInfo) object that defines the queue. |
Long integer (default is INFINITE). Maximum size is based on the memory available in the computer where the queue's messages are stored.
Quota is typically set when the queue is created.
To set the quota of a queue, set Quota and call the MSMQQueueInfo object's Create method.
To reset the quota of a queue after the queue is created, set Quota to a new level, and, if the queue is open, call the MSMQQueueInfo object's Update method. If the queue is not open do not call Update because the queue's properties are updated automatically when the queue is opened.
To find the quota of a queue, call the MSMQQueueInfo object's Refresh method.
This example creates a private queue on the local computer, setting the queue's quota to 10K. To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, run the example, and click the form.
Dim qinfo As MSMQQueueInfo
Private Sub Form_Click()
Set qinfo = New MSMQQueueInfo
qinfo.PathName = ".\myqueue"
qinfo.Label = "Test Queue"
qinfo.Quota = 10
qinfo.Create
MsgBox "Queue's Format name is: " + qinfo.FormatName
End Sub
Windows NT: Requires version 4.0 SP3 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mqoai.h.
Import Library: Use mqoa.lib.
Unicode: Defined only as Unicode.
Create, FormatName, Label, MSMQQueueInfo, PathName, Update