After you have imported and partially set up this sample, then performed the appropriate setup instructions, you can run the sample by following the instructions in the Running the sample section below.
This topic also includes an example input test message and a corresponding output message, so that you can confirm that the sample has worked.
The test message used in running this sample is based on the following format:
<routingfilenode>
<routingvalue>out</routingvalue>
</routingfilenode>
where the value out contains the key identfier used to look up the terminal to which the message should be routed, from the routingtable.cfg properties file. This file is a simple text file containing:
out out alternate alternate
To route the message to the alternate node, edit the input message and replace out with alternate.
This sample uses the message flow RoutingFileNodeFlow. It contains one input queue called JAVACOMPUTE.ROUTING.IN, and the message flow can route the
message to one of three output queues (JAVACOMPUTE.ROUTING.OUT, JAVACOMPUTE.ROUTING.ALTERNATE and JAVACOMPUTE.ROUTING.FAILURE).
To run the sample:
Try repeating the steps above, after editing the input message so out is replaced with alternate. You should see the message routed to the JAVACOMPUTE.ROUTING.ALTERNATE queue instead.
If all the steps above have worked then the sample is complete. Take a look at the Java code in the message flow RoutingFileNodeFlow to see how the message routing was achieved.
The output message from the sample should be identical to the input message, as this sample covers only routing of messages, not transformation. When the input message contains a value of out, then the message is routed to the out terminal. If it contains alternate, it is routed to the alternate terminal.
<routingfilenode>
<routingvalue>out</routingvalue>
</routingfilenode>