IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Handling exceptions in aggregation flows

When you use aggregation flows, exceptions might occur.

Before you start:

Complete the following tasks:

Dealing with exceptions

If an error is detected downstream of an AggregateReply node, the broker issues an exception. Another node in the message flow might also issue an exception using the ESQL THROW statement. In either case, when an exception occurs, it is caught in one of two places:

  • The input node on which the replies arrive
  • The AggregateReply node

The following table lists events and describes what happens to an exception that occurs downstream of the AggregateReply node.

Event Message propagated Output terminal Exception caught at
An expected reply arrives at the input node and is passed to the In terminal of the AggregateReply node. The reply is the last one that is needed to make an aggregation complete. An aggregated reply message that contains all the replies Out Input node
An unexpected reply arrives at the input node and is passed to the AggregateReply node. The reply is not recognized as a valid reply, and the Unknown Message Timeout property is set to 0. Message received Unknown Input node
A timeout occurs because all the replies for an aggregation have not yet arrived. An aggregated reply message that contains all the replies that have been received Timeout AggregateReply node
An unknown timeout occurs because a retained message is not identified as a valid reply. Retained message Unknown AggregateReply node
An aggregation is discovered to be complete at some time other than when the last reply arrived. An aggregated reply message that contains all the replies Out AggregateReply node

To handle errors that occur in aggregation flows, you must catch these exceptions at all instances of each of these nodes in the message flow.

  1. Switch to the Integration Development perspective.
  2. Open the message flow with which you want to work.
  3. To handle these exceptions yourself, connect the Catch terminal of each input and AggregateReply node to a sequence of nodes that handles the error that has occurred.

    For a unified approach to error handling, connect the Catch terminals of all these nodes to a single sequence of nodes, or create a subflow that handles errors in a single consistent manner, and connect that subflow to each Catch terminal.

  4. If you want the broker to handle these exceptions using default error handling, do not connect the Catch terminals of these nodes.
If you connect the Catch terminal of the AggregateReply node, and want to send the message that is propagated through this terminal to a destination from which it can be retrieved for later processing, include a Compute node in the catch flow to provide any transport-specific processing. For example, you must add an MQMD header if you want to put the message to a WebSphere® MQ queue from an MQOutput node.

The following ESQL example shows you how to add an MQMD header and pass on the replies that are received by the AggregateReply node:

-- Add MQMD
SET OutputRoot.MQMD.Version = 2;
.
-- Include consolidated replies in the output message
SET OutputRoot.XMLNS.Data.Parsed = InputRoot.ComIbmAggregateReplyBody;
.

To propagate the information about the exception in the output message, set the Compute mode property of the Compute node to a value that includes Exception.


ac12340_.htm | Last updated Friday, 21 July 2017