WebSphere Message Brokers
File: ac04830_
Writer: Terry Cowling

Reference topic

This build: July 31, 2007 21:17:41

Throw node

The topic describes the Throw node.

This topic contains the following sections:

Purpose

Use the Throw node to throw an exception within a message flow. The exception can be caught and processed by:

  • A preceding TryCatch node
  • The message flow input node (the built-in nodes HTTPInput, MQInput, JMSInput, and SCADAInput all have Catch terminals)
  • A preceding AggregateReply node

Include a Throw node to force an error path through the message flow if the content of the message contains unexpected data. For example, to back out a message that does not contain a particular field, you can check (using a Filter node) that the field exists; if the field does not exist, the message can be passed to a Throw node that records details about the exception in the ExceptionList subtree within the message.

The Throw node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:

Throw node icon

Using this node in a message flow

Look at the following samples to see how to use this node: You can view samples only when you use the information center that is integrated with the Message Brokers Toolkit.

Include a Throw node with a TryCatch node in your message flow to alert the systems administrator of a potential error situation; for example, if you have a Compute node that calculates a number, test the result of this calculation and throw an exception if the result exceeds a certain amount. The TryCatch node catches this exception and propagates the message to a sequence of nodes that process the error.

Configuring the Throw node

When you have put an instance of the Throw node into a message flow, you can configure it; see Configuring a message flow node. The properties of the node are displayed in the Properties view.

All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk.

Configure the Throw node as follows:

  1. Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab.
  2. On the Basic tab:
    1. In Message Catalog, enter the fully-qualified path and file name of the message catalog that contains the message source. This file can be your own message catalog, or the default message catalog that is supplied with WebSphere Message Broker. To use the default supplied catalog, leave this property blank.
    2. In Message Number, enter the error number of the exception that is being thrown.
      • If you have created your own message catalog, enter the number for the message in the catalog that you want to use when this exception is thrown.
      • If you are using the default message catalog, specify a number between 3001 and 3049. These numbers are reserved in the WebSphere Message Broker catalog for your use. The text of each of these messages in the default message catalog is identical, but you can use a different number within this range for each situation in which you throw an exception; use the number to identify the exact cause of the error.

      The default message number is 3001.

    3. In Message Text, enter any additional free format text that contains information that you want to include with the message when it is written to the local error log; for example, if you have checked for the existence of a particular field in a message and thrown an exception when that field is not found, you might include the text:
      The message did not contain the required field: Branch number
      If you are using the default message catalog, this text is inserted as &1 in the message text.

Terminals and properties

The Throw node terminal is described in the following table.

Terminal Description
In The input terminal that accepts a message for processing by the node.

The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the bar file to deploy it).

The Throw node Description properties are described in the following table.

Property M C Default Description
Node name No No The node type The name of the node.
Short Description No No   A brief description of the node.
Long Description No No   Text that describes the purpose of the node in the message flow.

The Throw node Basic properties are described in the following table.

Property M C Default Description
Message Catalog No No   The name of the message catalog from which the error text for the error number of the exception is extracted. The default value (blank) indicates that the message is taken from the message catalog that is supplied with WebSphere Message Broker.
Message Number No No 3001 The error number of the exception that is being thrown.
Message Text No No   Additional text that explains the cause of the error.
Notices | Trademarks | Downloads | Library | Support | Feedback

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

ac04830_ This topic's URL is: