About the RoutingFileNode sample

This sample demonstrates how a JavaCompute node can be used as a filter node, with the filtering rules being loaded from an external source, in this case a properties file.

The routing rules are loaded from a properties file, routingtable.cfg, that is deployed with the node. The node extracts a routingvalue element value from the incoming message. This value is then used to look up the terminal to which the message is routed.

This sample completes the following tasks:

  1. Extracts a routingvalue element value from an incoming message, by using XPath expressions.
  2. Loads routing rules from a properties file, routingtable.cfg, that is deployed with the node.
  3. Uses the extracted value from the routing table to look up the terminal to which the message is routed.
  4. If a routing rule is found, the sample routes and propagates the message to the appropriate terminal of the JavaCompute node.
  5. If a routing rule is not found, the sample logs the error and throws an MbUserException exception. The message is routed to the Failure terminal of the JavaCompute node.

The following WebShere MQ queues are created by the sample:

The following message flow, RoutingFileNodeFlow, is imported by the sample:

RoutingFileNodeFlow

Back to About the JavaCompute Node sample