This represents access to a WebSphere MQ queue. This connection is provided by an associated MQQueueManager object. When an object of this class is destroyed it is automatically closed.
Contained by the MQQueueManager class.
New creates a new MQQueue object and sets all the properties to initial values. Alternatively, use the AccessQueue Method of the MQQueueManager class.
Dim que As New MQQueue
Set que = New MQQueue
If the queue object is not connected to a queue manager, you can read the following properties:
and you can read and write to:
If the queue object is connected to a queue manager, you can read all the properties.
Properties not listed in the previous section are all attributes of the underlying WebSphere 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 authorisation instead.
The property must be an appropriate property for the given QueueType. See the WebSphere MQ Application Programming Reference manual.
If these conditions do not apply, the property access will set a CompletionCode of MQCC_FAILED and one of the following ReasonCodes:
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. WebSphere MQ validates the OpenOptions against the user authorization as part of the open queue process.
Read-write. The alternate user ID used to validate access to the queue when it is opened.
This property cannot be set while the object is open (that is, when IsOpen is TRUE).
Defined in: MQQueue class
Data Type: String of 12 characters
Syntax:
To get: altuser$ =
MQQueue.AlternateUserId
To set: MQQueue.AlternateUserId = altuser$
Read-only. The MQI BackOutRequeueQName attribute.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: backoutrequeuename$ =
MQQueue.BackoutRequeueName
Read-only. The MQI BackoutThreshold attribute.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: backoutthreshold& =
MQQueue.BackoutThreshold
Read-only. The queue name to which the alias resolves.
Valid only for alias queues.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: baseqname$ =
MQQueue.BaseQueueName
Read-Write. Options used to control what happens when the queue is closed.
Defined in: MQQueue class
Data Type: Long
Values:
MQCO_DELETE and MQCO_DELETE_PURGE are valid only for dynamic queues.
Syntax:
To get: closeopt& =
MQQueue.CloseOptions
To set: MQQueue.CloseOptions = closeopt&
Read-only. Returns the completion code set by the last method or property access issued against the object.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: completioncode& =
MQQueue.CompletionCode
Read-write. Defines the queue manager object to which a queue object belongs. The connection reference cannot be written while a queue is open.
Defined in: MQQueue class
Data Type: MQQueueManager
Values:
Syntax:
To set: set MQQueue.ConnectionReference =
ConnectionReference
To get: set ConnectionReference = MQQueue.ConnectionReference
Read-only. Date and time this queue was created.
Defined in: MQQueue class
Data Type: Variant of type 7 (date/time) or EMPTY
Syntax:
To get: datetime = MQQueue.CreationDateTime
Read-only. The number of messages currently on the queue.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: currentdepth& =
MQQueue.CurrentDepth
Read-only. Controls the way that the queue is opened if the OpenOptions specify MQOO_INPUT_AS_Q_DEF.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: defaultinop& =
MQQueue.DefaultInputOpenOption
Read-only. The default persistence for messages on a queue.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: defpersistence& =
MQQueue.DefaultPersistence
Read-only. The default priority for messages on a queue.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: defpriority& =
MQQueue.DefaultPriority
Read-only. Queue definition type.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: deftype& =
MQQueue.DefinitionType
Read-only. The MQI QDepthHighEvent attribute.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: depthhighevent& =
MQQueue.DepthHighEvent
Read-only. The MQI QDepthHighLimit attribute.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: depthhighlimit& =
MQQueue.DepthHighLimit
Read-only. The MQI QDepthLowEvent attribute.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: depthlowevent& =
MQQueue.DepthLowEvent
Read-only. The MQI QDepthLowLimit attribute.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: depthlowlimit& =
MQQueue.DepthLowLimit
Read-only. The MQI QDepthMaxEvent attribute.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: depthmaximumevent& =
MQQueue.DepthMaximumEvent
Read-only. A description of the queue.
Defined in: MQQueue class
Data Type: String of 64 characters
Syntax:
To get: description$ =
MQQueue.Description
Read-write, read-only when the queue is open.
This controls the dynamic queue name used when a model queue is opened. It may be set with a wildcard by the user either as a property set (only when the queue is closed) or as a parameter to MQQueueManager.AccessQueue().
The actual name of the dynamic queue is found by querying QueueName.
Defined in: MQQueue class
Data Type: String of 48 characters
Values:
Syntax:
To set: MQQueue.DynamicQueueName =
dynamicqueuename$
To get: dynamicqueuename$ = MQQueue.DynamicQueueName
Read-only. Whether to maintain an accurate back-out count.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: hardengetback& =
MQQueue.HardenGetBackout
Read-write. The MQI InhibitGet attribute.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: getstatus& = MQQueue.InhibitGet
To set: MQQueue.InhibitGet = getstatus&
Read-write. The MQI InhibitPut attribute.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: putstatus& = MQQueue.InhibitPut
To set: MQQueue.InhibitPut = putstatus&
Read-only. Name of initiation queue.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: initqname$ =
MQQueue.InitiationQueueName
Read-only. Returns whether or not the queue is open.
Defined in: MQQueue class
Data Type: Boolean
Values:
Syntax:
To get: open = MQQueue.IsOpen
Read-only. Maximum queue depth.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: maxdepth& =
MQQueue.MaximumDepth
Read-only. Maximum permitted message length in bytes for this queue.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: maxmlength& =
MQQueue.MaximumMessageLength
Read-only. Message delivery sequence.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: messdelseq& =
MQQueue.MessageDeliverySequence
Read-write. The MQI Queue attribute. This property cannot be written after the MQQueue is open.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: name$ = MQQueue.name
To set: MQQueue.name = name$
Read-only. The object handle for the WebSphere MQ queue object.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: hobj& =
MQQueue.ObjectHandle
Read-only. Number of opens for input.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: openincount& =
MQQueue.OpenInputCount
Read-write. Options to be used for opening the queue.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: openopt& = MQQueue.OpenOptions
To set: MQQueue.OpenOptions = openopt&
Read-only. Number of opens for output.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: openoutcount& =
MQQueue.OpenOutputCount
Read-only. Indicates if the queue is opened or not. Initial value is TRUE after AccessQueue method or FALSE after New.
Defined in: MQQueue class
Data Type: Boolean
Values:
Syntax:
To get: status& = MQQueue.OpenStatus
Read-only. The MQI ProcessName attribute.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: procname$
=MQQueue.ProcessName
Read-write. The WebSphere MQ queue manager name.
Defined in: MQQueue class
Data Type: String
Syntax:
To get: QueueManagerName$ =
MQQueue.QueueManagerName
To set: MQQueue.QueueManagerName = QueueManagerName$
Read-only. The MQI QType attribute.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: queuetype& = MQQueue.QueueType
Read-only. Returns the reason code set by the last method or property access issued against the object.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: reasoncode& =
MQQueue.ReasonCode
Read-only. Returns the symbolic name of the latest reason code. For example, "MQRC_QMGR_NOT_AVAILABLE".
Defined in: MQQueue class
Data Type: String
Values:
Syntax:
To get: reasonname$ =
MQQueue.ReasonName
Read-only. Name of remote queue manager. Valid for remote queues only.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: remqmanname$ =
MQQueue.RemoteQueueManagerName
Read-only. The name of the queue as it is known on the remote queue manager. Valid for remote queues only.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: remqname$ =
MQQueue.RemoteQueueName
Read-only. The name of the final destination queue manager as known to the local queue manager.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: resqmanname$ =
MQQueue.ResolvedQueueManagerName
Read-only. The name of the final destination queue manager as known to the local queue manager.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: resqmanname$ =
MQQueue.ResolvedQueueName
Read-only. The period of time for which the queue should be retained.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: retinterval& =
MQQueue.RetentionInterval
Read-only. Controls whether an entry for this queue also exists in a cell directory.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: scope& = MQQueue.Scope
Read-only. The MQI QServiceInterval attribute.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: serviceinterval& =
MQQueue.ServiceInterval
Read-only. The MQI QServiceIntervalEvent attribute.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: serviceintervalevent& =
MQQueue.ServiceIntervalEvent
Read-only. Queue shareability.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: shareability& =
MQQueue.Shareability
Read-only. Transmission queue name. Valid for remote queues only.
Defined in: MQQueue class
Data Type: String of 48 characters
Syntax:
To get: transqname$ =
MQQueue.TransmissionQueueName
Read-write. Trigger control.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: trigcontrol& =
MQQueue.TriggerControl
To set: MQQueue.TriggerControl = trigcontrol&
Read-write. Trigger data.
Defined in: MQQueue class
Data Type: String of 64 characters
Syntax:
To get: trigdata$ =
MQQueue.TriggerData
To set: MQQueue.TriggerData = trigdata$
Read-write. The number of messages that have to be on the queue before a trigger message is written.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: trigdepth& =
MQQueue.TriggerDepth
To set: MQQueue.TriggerDepth = trigdepth&
Read-write. Threshold message priority for triggers.
Defined in: MQQueue class
Data Type: Long
Syntax:
To get: trigmesspriority& =
MQQueue.TriggerMessagePriority
To set: MQQueue.TriggerMessagePriority = trigmesspriority&
Read-write. Trigger type.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: trigtype& = MQQueue.TriggerType
To set: MQQueue.TriggerType = Trigtype&
Read-only. Indicates what the queue is used for.
Defined in: MQQueue class
Data Type: Long
Values:
Syntax:
To get: usage& = MQQueue.Usage
Resets the CompletionCode to MQCC_OK and the ReasonCode to MQRC_NONE for both the MQQueue class and the MQSession class.
Defined in: MQQueue class
Syntax:
Call MQQueue.ClearErrorCodes()
Closes a queue using the current values of CloseOptions.
Defined in: MQQueue class
Syntax:
Call MQQueue.Close()
Retrieves a message from the queue.
This method takes an MQMessage object as a parameter. It uses some of the fields in this object's MQMD as input parameters - in particular the MessageId and CorrelId, so it is important to ensure that these are set as required. See the WebSphere MQ Application Programming Reference for details.
If the method fails then the MQMessage object is unchanged. If it succeeds then the MQMD and Message Data portions of the MQMessage object are completely replaced with the MQMD and Message Data from the incoming message. The MQMessage control properties are set as follows
Syntax:
Call MQQueue.Get(Message, GetMsgOptions,
GetMsgLength)
MQMessage Object representing message to be retrieved.
GetMsgOptions:
Optional MQGetMessageOptions object to control the get operation. If these are not specified, default MQGetMessageOptions are used.
GetMsgLength:
Optional 2- or 4-byte length value to control the maximum length of the WebSphere MQ message that will be retrieved from the queue.
If the MQGMO_ACCEPT_TRUNCATED_MSG option is specified, the GET succeeds with a completion code of MQCC_WARNING and a reason code of MQRC_TRUNCATED_MSG_ACCEPTED if the message size exceeds the specified length.
The MessageData holds the first GetMsgLength bytes of data.
If MQGMO_ACCEPT_TRUNCATED_MSG is not specified, and the message size exceeds the specified length, the completion code of MQCC_FAILED together with reason code MQRC_TRUNCATED_MESSAGE_FAILED is returned.
If the contents of the message buffer are undefined, the total message length is set to the full length of the message that would have been retrieved.
If the message length parameter is not specified, the length of the message buffer is automatically adjusted to at least the size of the incoming message.
Opens a queue using the current values of:
Syntax:
Call MQQueue.Open()
Places a message onto the queue.
This method takes an MQMessage object as a parameter. The Message Descriptor (MQMD) properties of this object may be altered as a result of this method. The values they have immediately after this method has run are the values that were put onto the WebSphere MQ.
Modifications to the MQMessage object after the Put has completed do not affect the actual message on the WebSphere MQ queue.
Syntax:
Call MQQueue.Put(Message,
PutMsgOptions)
MQMessage object representing message to be put.
PutMsgOptions
MQPutMessageOptions object containing options to control the put operation. If these are not specified, default PutMessageOptions are used.