WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
Implementing the supplied user-defined extension samples
WebSphere® Message Broker provides some sample code to help you understand how to write user-defined nodes and parsers.
You can see sample code for user-defined
extensions in the following ways:
- By using the sample that is supplied in the WebSphere Message Broker Toolkit. To use the sample, see User-defined Extension.
You can view information about samples only when you use the information center that is integrated with the WebSphere Message Broker Toolkit or the online information center. You can run samples only when you use the information center that is integrated with the WebSphere Message Broker Toolkit.
- By using sample code that is installed with WebSphere Message Broker. To use the sample code, read the following information in this topic.
The sample code consists of a sample parser, and the following
sample nodes:
Node | Description |
---|---|
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 from the sample code that is installed with WebSphere Message
Broker:
- Compile the samples. For information about how to compile a Java node, see Compiling a Java user-defined node. For information about how to compile a C node or parser, see Compiling a C user-defined extension.
- Install the user-defined extension in a broker domain. For instructions on completing this step, see Installing user-defined extension runtime files on a broker.
- Copy and extract the SampleNodesProject.zip file
by completing the following steps:
- From a computer that has WebSphere Message Broker installed, copy the SampleNodesProject.zip file to a computer with WebSphere Message Broker Toolkit installed. The .zip file is in the sample subdirectory. For example, on Windows, the SampleNodesProject.zip is in the install_dir\sample\extensions\nodes\com.ibm.samples.nodes directory, where install_dir is the home directory of your WebSphere Message Broker installation.
- On the computer that has the WebSphere Message Broker Toolkit installed, extract the SampleNodesProject.zip file, and copy the extracted files to a directory from which the WebSphere Message Broker Toolkit can access them. For more information about where to copy the files, see Installing a user-defined extension to current and past versions of WebSphere Message Broker.
- Open the WebSphere Message Broker Toolkit 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 it. 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 Packaging and 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 that contains the sample node is deployed successfully; see Checking the results of deployment.
- Use the Enqueue message function to put the sample input messages (provided in .xml files) to the input queue named on the input node of the message flow; see Debug: putting a test message on an input queue.