Implementing the provided samples

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:
  1. 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.
  2. 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
  3. 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.
  4. 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".
  5. Include the sample nodes in a message flow (see Adding a message flow node).
  6. Deploy the message flow (see Deploying).
  7. 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:
    1. Make sure that the message flow containing the sample node is deployed successfully (see Checking the results of deployment).
    2. 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.
Related concepts
User-defined extensions
Related tasks
Adding a message flow node
Testing and debugging message flow applications
Developing user-defined extensions
Compiling a Java user-defined node
Compiling a C user-defined extension
Checking the results of deployment
Troubleshooting and support
Related reference
Trace node
User-defined extensions