WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
Routing a message using a .NETCompute node
Route a message by using the .NETCompute node as a filter node.
Before you start:
Add a .NETCompute node to your message flow.
By default, the output message assembly is propagated to the Out terminal after the evaluate method in the .NET code has been processed. However, the .NETCompute node supports dynamic terminals. You can create extra terminals, and use the .NETCompute as a filter node by propagating a message to the appropriate terminal, based on the message content.
The following snippet of C# code shows how you might filter a message, depending on the content of an element in the message:
#region UserCode
// Add user code in this region to filter the message
if (root[NBParsers.XMLNSC.ParserName].LastChild.Name.Equals("LoyaltyProgram"))
{
outTerminal.Propagate(assembly);
}
if (root[NBParsers.XMLNSC.ParserName].LastChild.Name.Equals("SaleEnvelope"))
{
altTerminal.Propagate(assembly);
}
else
{
failureTerminal.Propagate(assembly);
}
#endregion UserCode
For more information about routing messages, see the .NETCompute Node sample.