+

Search Tips | Advanced Search

MQQueue class

This class represents access to an IBM MQ queue. This connection is provided by an associated MQQueueManager object. When an object of this class is destroyed it is automatically closed.


Containment

The MQQueue class is contained by the MQQueueManager class.


Creation

New creates a new MQQueue object and sets all the properties to initial values. Alternatively, use the AccessQueue method of the MQQueueManager class.


Syntax

 Dim que As New MQQueue Set que = New MQQueue


Properties


Methods


Property Access

If the queue object is not connected to a queue manager, we can read the following properties:

and we can read and write to:

If the queue object is connected to a queue manager, we can read all the properties.


Queue Attribute properties

Properties not listed in the previous section are all attributes of the underlying IBM MQ queue. They can be accessed only if the object is connected to a queue manager, and the user's user ID is authorized for Inquire or Set against that queue. If an alternate user ID is set and the current user ID is authorized to use it, the alternate user ID is checked for authorization instead.

The property must be an appropriate property for the given QueueType. See Attributes for queues for more information.

If these conditions do not apply, the property access will set a CompletionCode of MQCC_FAILED and one of the following ReasonCodes:


Opening a queue

The only way to create an MQQueue object is by using the MQQueueManager AccessQueue method or by New. An open MQQueue object remains open (OpenStatus=TRUE) until it is closed or deleted or until the creating queue manager object is deleted or connection is lost to the queue manager. The value of the MQQueue CloseOptions property controls the behavior of the close operation that takes place when the MQQueue object is deleted.

The MQQueueManager AccessQueue method opens the queue using the OpenOptions parameter. The MQQueue.Open method opens the queue using the OpenOptions property. IBM MQ validates the OpenOptions against the user authorization as part of the open queue process.