Message conversion outside the message exit

Before calling the message exit, the receiving MCA performs some conversions on the message. This topic describes the algorithms used to perform the conversions.


Which headers are processed

A conversion routine runs in the MCA of the receiver before the message exit is called. The conversion routine begins with the MQXQH header at the beginning of the message. The conversion routine then processes through the chained headers that follow the MQXQH, performing conversion where necessary. The chained headers can extend beyond the offset contained in the HeaderLength parameter of the MQCXP data that is passed to the message exit of the receiver. The following headers are converted in-place:

  • MQXQH (format name " MQXMIT ")
  • MQMD (this header is part of the MQXQH and has no format name)
  • MQMDE (format name " MQHMDE ")
  • MQDH (format name " MQHDIST ")
  • MQWIH (format name " MQHWIH ")
The following headers are not converted, but are stepped over as the MCA continues to process the chained headers:

  • MQDLH (format name " MQDEAD ")
  • any headers with format names beginning with the three characters 'MQH' (for example " MQHRF ") that are not otherwise mentioned


How the headers are processed

The Format parameter of each IBM MQ header is read by the MCA. The Format parameter is 8 bytes within the header, which are 8 single-byte characters containing a name.

The MCA then interprets the data following each header as being of the named type. If the Format is the name of a header type eligible for IBM MQ data conversion, it is converted. If it is another name indicating non-MQ data (for example MQFMT_NONE or MQFMT_STRING) then the MCA stops processing the headers.


What is the MQCXP HeaderLength?

The HeaderLength parameter in the MQCXP data supplied to a message exit is the total length of the MQXQH (which includes the MQMD), MQMDE and MQDH headers at the start of the message. These headers are chained using the 'Format' names and lengths.


MQWIH

Chained headers can extend beyond the HeaderLength into the user data area. The MQWIH header, if it is present, is one of those headers that appear beyond the HeaderLength.

If there is an MQWIH header in the chained headers, it is converted in-place before the message exit of the receiver is called.