WebSphere Message Brokers
File: ac37700_
Writer: Cerys Giddings

Task topic

This build: July 31, 2007 21:20:56

Creating a flow for message collection

Use a Collector node in your message flows to group messages from one or more sources into a message collection. You can add dynamic input terminals to your Collector node for each message source you want to configure for your message flow.

Before you start:

To complete this task, you must have completed the following task:

Before completing this task, read the overview about message collection; see Message collection.

To review an example of a message flow that uses message collections, see the Collector node sample that is supplied with WebSphere Message Broker.

To create a message flow to generate and process message collections:

  1. Switch to the Broker Application Development perspective.
  2. Create a new message flow.
  3. Add the following nodes in the editor view, and configure and connect them as described:

    Input nodes

    The input nodes receive the messages from which message collections are generated. You can use any of the built-in nodes, or user-defined input nodes.
    1. Add an input node for each source of input messages for your message flow, for example an MQInput node and a JMSInput node.
    2. For each input node, right-click the input node and click Properties.
    3. Specify the source of input messages for this node. For example, specify the name of a WebSphere MQ queue in the Basic property Queue Name from which the MQInput node retrieves messages.
    4. Optional: specify values for any other properties that you want to configure for this node.

    Collector node

    The Collector node receives messages from input nodes or other nodes in the message flow. You must add a dynamic input terminal to the Collector node for each input message source before you can connect the input nodes or any upstream nodes to the Collector node.
    1. Add a Collector node to your message flow.
    2. Right-click on the Collector node and click Add Input Terminal to add a new dynamic input terminal to the Collector node. Add a new input terminal for each input source that you plan to add to your message flow; for more information about adding dynamic input see Adding an input terminal for each input source.
    3. Connect the out terminal of each input node to one of the dynamic input terminals of the Collector node. Repeat this for each input node, connecting each input node to a different input terminal on the Collector node. This represents the simplest configuration; if appropriate, you can include other nodes between the input node and the Collector node. For example, you might want to store the request for audit purposes (in a Warehouse node), or add a unique identifier to the message (in a Compute node).

    Processing nodes

    You can process message collections from a Collector node using the following nodes only:
    • Compute
    • JavaCompute

    You must connect either a Compute node or a JavaCompute node to the Collector node in your message flow. Use these nodes to process the message collection and propagate other messages. You can use ESQL or XPATH to access the contents of the individual messages in the message collection for processing

    To process a message collection:
    1. Add a Compute node or a JavaCompute node to your message flow.
    2. Code your ESQL or Java to create single output messages from the message collection.
    3. Optional: specify values for any other properties that you want to configure for this processing node.
    4. Connect the out terminal of the processing node to the in terminal of an output node or other processing node.
    5. Optional: add other nodes to your message flow for further processing.

    Output node

    Include one or more output nodes for your message flow. This can be any of the built-in nodes, or a user-defined output node. An output node can not process a message collection, so ensure that you connect the output node to a processing node that propagates single output messages.

    To configure an output node:
    1. Right-click the output node and click Properties.
    2. Specify the destination properties for this node. For example, specify the name of a WebSphere MQ queue in the Basic property Queue Name to which the MQOutput node sends messages.
    3. Optional: specify values for any other properties that you want to configure for this node.

    Error handling nodes

    Include processing for handling errors and expired message collections:
    1. Optional: add processing nodes to your message flow to handle expired message collections. Connect these nodes to the Expire terminal.
    2. Optional: add processing or error handling nodes to handle any exceptions in your message flow. Connect these nodes to the Catch terminal.
    If an error is detected downstream of the Collector node, the broker throws an exception. The message collection is propagated to the Collector node's Catch terminal. Connect the Catch terminal to a sequence of nodes that handles the errors to avoid losing any data, and ensure that no further exceptions can be generated during error processing. The node connected to the Catch terminal must be either a Compute node or a JavaCompute node to handle the message collection.
  4. Press Ctrl-S to save the message flow and validate its configuration.
If you want to control when complete message collections are propagated, you must also add additional nodes to your message flow. For information about using control messages, see Using control messages with the Collector node.
Next: Configure the Collector node.
Related concepts
Message flows overview
Message collection
Related tasks
Configuring flows for message collection
Configuring the Collector node
Handling exceptions in the collector node
Related reference
Collector node
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:20:56

ac37700_ This topic's URL is: