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:

The Message Descriptor properties are:

 

Methods

 

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.