August 15, 2023

cOnException – Docs for ESB 6.x


Catches the exceptions defined and triggers certain actions which are then
performed on these exceptions and the message routing.

cOnException Standard properties

These properties are used to configure cOnException running in the Standard Job framework.

The Standard
cOnException component belongs to the Exception Handling family.

Basic settings


Click the plus button to add as many lines as needed in the table
to define the exceptions to be caught.

Set a redelivering tries count

Select this check box to set the maximum redelivering tries in the
Maximum redelivering tries

Non blocking asynchronous behavior

Select this check box to enable asynchronous delayed

For details, go to

Exception behavior

None: select this option to take
no action on the original route.

Handle the exceptions: select
this option to handle exceptions and break out the original

Ignore the exceptions: select
this option to ignore the exceptions and continue routing in the
original route.

Route the original input body instead of the current

Select this check box to route the original message instead of the
current message that might be changed during the routing.


Usage rule

cOnException is used as a separate
component in a Route.



Scenario: Using cOnException to ignore exceptions and continue message

This scenario applies only to a Talend solution with ESB.

In this scenario, a cOnException component is used to
ignore an IO exception thrown by a Java bean so that the message is successfully routed
to the destination in spite of the exception.


Dropping and linking the components

  1. Drag and drop these components from the Palette onto the workspace: a cOnException component, a cFile component, a cBean
    component, and cProcessor component.
  2. Link cFile to cBean using a Row >
    Route connection.
  3. Link cBean to cProcessor using a Row >
    Route connection.
  4. Label the components to better identify their roles in the Route.

Configuring the components

  1. Double-click the cOnException component,
    which is labelled Ignore_exception, to
    open its Basic settings view in the
    Component tab.


  2. Click the plus button to add a line in the Exceptions table, and define the exception to catch. In this
    example, enter to handle IO

    In the Exception behavior area, select
    the Ignore the exceptions option to ignore
    exceptions and let message routing continue. Leave the other parameters as
    they are.
  3. Double-click the cFile component, which
    is labelled Source, to open its Basic settings view in the Component tab.


  4. In the Path field, enter the path of the
    message source, and leave the other parameters as they are.
  5. Double-click the cBean component, which
    is labelled Throw_exception, to open its
    Basic settings view in the Component tab.


  6. Select New Instance and in the Bean class field, enter the name of the bean to
    throw an IO exception, beans.throwIOException.class in this scenario.

    Note that this bean has already been defined in the Code node of the Repository
    and it looks like
    For more information about creating and using Java Beans, see

    Talend Studio User Guide
  7. Double-click the cProcessor component,
    which is labelled Monitor, to open its
    Basic settings view in the Component tab.


  8. In the Code area, customize the code to
    display the file name of the consumed message on the Run console:

  9. Press Ctrl+S to save your Route.

Viewing code and executing the Route

  1. Click the Code tab at the bottom of the
    design workspace to check the generated code.


    As shown above, Ignore_exception handles any IO exception
    thrown by .bean(beans.throwIOException.class) invoked by
    cBean_1, so that messages from the endpoint
    Source can be successfully routed onwards
    (continued(true)) in spite of the exception.
  2. Press F6 to execute the Route.

    The route gets executed successfully and the files from the source are
    successfully routed to the destination.

  3. Change the exception handling option in the cOnException component or deactivate the component and run
    the Route again.

    The exception thrown by the Java bean prevents the messages from being
    routed successfully.

Document get from Talend
Thank you for watching.
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x