After you have imported and deployed the sample, you can run it by following the instructions in the Running the sample section.
If you encounter any problems when you run the sample, see Resolving problems when running samples in the WebSphere Message Broker documentation.
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 that is used for 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 routes the message to the Alternate terminal.
This sample uses the message flow RegexFilterNodeFlow. The flow contains one input queue called JAVACOMPUTE.REGEX.IN. 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:
Edit the input message so that the value of filterRegex is not out, and then try repeating the previous steps. The message is routed to the JAVACOMPUTE.REGEX.ALTERNATE queue instead.
If all the preceding steps are successful, the sample is complete. Look at the Java code in the RegexFilterNodeFlow message flow to see how the message routing was achieved.
The output message from the sample should be identical to the input message, because this sample covers only routing of messages, not transformation. When the input message contains a value of out for filterRegex, the message is routed to the Out terminal, otherwise it is routed to the Alternate terminal.
<regexfilter>
<regex>out</regex>
</regexfilter>