Use a .NETCompute node to access headers in the message assembly.
For more information about the contents of these and other WebSphere MQ headers for which IBM® Integration Bus provides a parser, see Element definitions for message parsers.
public override void Evaluate(NBMessageAssembly inputAssembly)
{
NBOutputTerminal outTerminal = OutputTerminal("out");
NBMessage inputMessage = inputAssembly.Message;
// Create a new empty message, ensuring it is disposed after use
using (NBMessage outputMessage = new NBMessage())
{
NBMessageAssembly outAssembly = new NBMessageAssembly(inputAssembly, outputMessage);
NBElement inputRoot = inputMessage.RootElement;
NBElement outputRoot = outputMessage.RootElement;
#region UserCode
// Add user code in this region to create a new output message
NBElement MQMD = outputRoot.CreateLastChildUsingNewParser(NBParsers.NBHeaderParsers.MQMD.ParserName);
NBElement MQRFH2 = outputRoot.CreateLastChildUsingNewParser(NBParsers.NBHeaderParsers.MQRFH2.ParserName);
#endregion UserCode
// Change the following if not propagating message to the 'Out' terminal
outTerminal.Propagate(outAssembly);
}
}