Use the MQRMH and MQMD structures

 

See the Application Programming Reference for a description of the fields in the reference message header and the message descriptor.

In the MQMD structure, set the Format field to MQFMT_REF_MSG_HEADER. The MQHREF format, when requested on MQGET, is converted automatically by WebSphere MQ along with any bulk data that follows.

Here is an example of the use of the DataLogicalOffset and DataLogicalLength fields of the MQRMH:

A putting application might put a reference message with:

Assuming that the object is 70 000 bytes long, the sending message exit sends the first 40 000 bytes along the channel in a reference message containing:

It then places another message on the transmission queue containing:

When this message exit is seen by the sending message exit, the remaining 30,000 bytes of data is appended, and the fields are set to:

The MQRMHF_LAST flag is also set.

For a description of the sample programs provided for the use of reference messages, see Sample programs (all platforms except z/OS).

 

Parent topic:

Reference messages


fg12750_