IBM App Connect Enterprise, Version 11.0.0.2 Operating Systems: Windows, Linux


Accessing the MQMD header by using a JavaCompute node

IBM® MQ and WebSphere® MQ Everyplace® messages include an MQMD header. You can use a JavaCompute node to refer to the fields in the MQMD, and to update them.

About this task

The following Java™ code shows how to add an MQMD header to your message:
public void addMqmd(MbMessage msg) throws MbException
{
	MbElement root = msg.getRootElement();

	// create a top level 'parser' element with parser class name
	MbElement mqmd = root.createElementAsFirstChild("MQHMD");

	// specify next parser in chain
	mqmd.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE,
		"Format",
		"XMLNS");
}

ac30430_.htm | Last updated 2018-11-02 14:45:21