See information about the latest product version
Accessing headers with a PHPCompute node
Access MQMD and MQRFH2 headers by using a PHPCompute node.
If an input node receives an input message that includes message headers that the input node recognizes, the node invokes the correct parser for each header. Parsers are supplied for most WebSphere® MQ headers. This topic provides guidance for accessing the information in the MQMD and MQRFH2 headers that you can follow when accessing other headers that are present in your messages.
For more information about the contents of these and other WebSphere MQ headers for which WebSphere Message Broker provides a parser, see Element definitions for message parsers.
Accessing the MQMD header
WebSphere MQ messages include an MQMD header. You can use a PHPCompute node to refer to the fields within the MQMD, and to update them.
The following PHP code shows how to add an MQMD header to your message:
$output_assembly->MQMD->Version = 2;
Accessing the MQRFH2 header
The following PHP code adds an MQRFH2 header to an outgoing message that is to be used to make a subscription request:
$output_assembly->MQRFH2->psc->Topic = 'department/sales';