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:
- Extracts a routingvalue element value from an incoming message, using XPath expressions.
- Load routing rules from a properties file, routingtable.cfg, that is deployed with the node.
- Uses the extracted value from the routing table to look up the terminal to which the message should be routed.
- If a routing rule was found, routes and propagates the message to the appropriate terminal of the JavaCompute node.
- 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:
- JAVACOMPUTE.ROUTING.IN
- JAVACOMPUTE.ROUTING.OUT
- JAVACOMPUTE.ROUTING.ALTERNATE
- JAVACOMPUTE.ROUTING.FAILURE
The following message flow, RoutingFileNodeFlow, is imported by the
sample:

Back to About the JavaCompute Node sample