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:
- Extracts a routingvalue element value from an incoming message, by using XPath expressions.
- Loads 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 is routed.
- If a routing rule is found, the sample routes and propagates the message to the
appropriate terminal of the JavaCompute node.
- 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:
- 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