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:
<regexfilter>
<regex>out</regex>
</regexfilter>
where regex is the value of the user-defined property filterField (default is regex), and out is the value of the user-defined property filterRegex (default is out). When the value of the filterRegex is out, the message is routed to the out terminal of the RegexFilterNode. A value of anything else will route the message to the alternate terminal.
This sample uses the message flow RegexFilterNodeFlow. It contains one input queue called JAVACOMPUTE.REGEX.IN, and the message flow can route the message to one of three output queues (JAVACOMPUTE.REGEX.OUT, JAVACOMPUTE.REGEX.ALTERNATE and JAVACOMPUTE.REGEX.FAILURE).
To run the sample:
Try repeating the steps above, after editing the input message so that the value of filterRegex is not out. You should see the message routed to the JAVACOMPUTE.REGEX.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 RegexFilterNodeFlow 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 for filterRegex, then the message is routed to the out terminal. Otherwise it is routed to the alternate terminal.
<regexfilter>
<regex>out</regex>
</regexfilter>