Containment
Messages are contained by the MQSession class.
Creation
New creates a new MQMessage object. Its Message Descriptor properties are initially set to default values, and its Message Data buffer is empty.
Syntax
Dim msg As New MQMessage
or
Set msg = New MQMessage
Properties
The control properties are:
- CompletionCode property
- DataLength property
- DataOffset property
- MessageLength property
- ReasonCode property
- ReasonName property
The Message Descriptor properties are:
- AccountingToken property
- AccountingTokenHex property
- ApplicationIdData property
- ApplicationOriginData property
- BackoutCount property
- CharacterSet property
- CorrelationId property
- CorrelationIdHex property
- Encoding property
- Expiry property
- Feedback property
- Format property
- GroupId property
- GroupIdHex property
- MessageData property
- MessageFlags property
- MessageId property
- MessageIdHex property
- MessageSequenceNumber property
- MessageType property
- Offset property
- OriginalLength property
- Persistence property
- Priority property
- PutApplicationName property
- PutApplicationType property
- PutDateTime property
- ReplyToQueueManagerName property
- ReplyToQueueName property
- Report property
- TotalMessageLength property
- UserId property
Methods
- ClearErrorCodes method
- ClearMessage method
- Read method
- ReadBoolean method
- ReadByte method
- ReadDecimal2 method
- ReadDecimal4 method
- ReadDouble method
- ReadDouble4 method
- ReadFloat method
- ReadInt2 method
- ReadInt4 method
- ReadLong method
- ReadNullTerminatedString method
- ReadShort method
- ReadString method
- ReadUTF method
- ReadUInt2 method
- ReadUnsignedByte method
- ResizeBuffer method
- Write method
- WriteBoolean method
- WriteByte method
- WriteDecimal2 method
- WriteDecimal4 method
- WriteDouble method
- WriteDouble4 method
- WriteFloat method
- WriteInt2 method
- WriteInt4 method
- WriteLong method
- WriteNullTerminatedString method
- WriteShort method
- WriteUTF method
- WriteString method
- WriteUInt2 method
- WriteUnsignedByte method
Property access
All properties can be read at any time.
The control properties are read-only, except for DataOffset which is read-write. The Message Descriptor properties are all read-write, except BackoutCount and TotalMessageLength which are both read-only.
Note however that some of the MQMD properties may be modified by the queue manager when the message is put onto an WebSphere MQ queue. See the WebSphere MQ Application Programming Reference for details.
We can pass binary data to an WebSphere MQ message by setting the CharacterSet property to the Coded Character Set Identifier of the queue manager (MQCCSI_Q_MGR), and passing it a string. We can use the chr$ function to set non-character data into the string.
Data conversion
The Read and Write methods perform data conversion. They convert between the ActiveX internal formats, and the WebSphere MQ message formats as defined by the Encoding and CharacterSet properties from the message descriptor. When writing a message you should, if possible, set values into Encoding and CharacterSet that match the characteristics of the recipient of the message before issuing a Write method. When reading a message, this is not normally required because these values will have been set from those in the incoming MQMD.
This is an additional data conversion step that happens after any conversion performed by the MQQueue.Get method.