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 should be routed.

This sample covers the following steps:

  1. Extracts a routingvalue element value from an incoming message, using XPath expressions.
  2. Load 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 should be routed.
  4. If a routing rule was found, routes and propagates the message to the appropriate terminal of the JavaCompute node.
  5. If a routing rule was not found, logs the error and throws an MbUserException exception. The message is routed to the failure terminal of the JavaCompute node.

The following MQ queues are created by the sample:

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

RoutingFileNodeFlow

Main Page iconBack to About the JavaCompute Node sample