WebSphere Message Broker provides some sample
code to help you understand how to write user-defined nodes and parsers. The
samples consist of a sample parser, and the following sample nodes:
Switch |
A node, implemented in both C and Java versions, that
propagates an input message to one of several output terminals depending on
the message content. |
Transform |
A node, implemented in both C and Java versions, that
performs a simple message transformation. |
Each sample node consists of the source files and some files
that you can use to test each node. For the sample parser there are only source
files. See Sample node files and Sample parser files for details of the sample files and where to find
them.
To implement the supplied samples:
- Compile the samples. For information on how to compile a Java node, see Compiling a Java user-defined node. For information on how to compile
a C node or parser, see Compiling a C user-defined extension.
- Install the user-defined extension on a broker domain. For
instructions on completing this step, see Installing a user-defined extension on a broker domain
- On the Windows machine hosting the workbench,
unzip the SampleNodesProject.zip file, which is located in the install_dir\sample\extensions\com.ibm.samples.nodes
directory, and copy the resulting directory structure into the install_dir\eclipse\plugins
directory.
- Open the workbench and switch to the Broker Application Development
perspective. The category called "Sample nodes"
is now visible in the palette, and the sample nodes are shown below them.
Documentation about the sample nodes is also visible in the help system under
"Samples".
- Include the sample nodes in a message flow (see Adding a message flow node).
- Deploy the message flow (see Deploying).
- For the Switch and Transform nodes, you can put a message to the input
queue of the message flow and observe the results, as follows:
- Make sure that the message flow containing the sample node is deployed
successfully (see Checking the results of deployment).
- Use the Enqueue message function to put the sample input messages (the
.xml files listed above) to the input queue named on the input node of the
message flow (see Putting a test message).
You can also use a Trace node or the Flow debugger to see what is happening
in your message flow.