cErrorHandler
cErrorHandler Standard properties
These properties are used to configure cErrorHandler running in the Standard Job framework.
The Standard
cErrorHandler component belongs to the Exception Handling family.
Basic settings
|
Default Handler |
This error handler does not support a dead letter queue and will |
| Â |
Set Maximum Redeliveries: select |
| Â |
Set Redelivery Delay: select this |
| Â |
Set Retry Attempted Log Level: |
| Â |
Asynchronized Delayed Redelivery: |
| Â |
More Configurations by Code: |
|
Dead Letter |
This handler supports attempting to redeliver the message exchange |
| Â |
Dead Letter Uri: select this Other parameters share the same meaning as those of the default |
|
Logging Handler |
This handler logs the exceptions. |
| Â |
Set Logger Name: select this |
| Â |
Set Log Level: select this check |
Usage
|
Usage rule |
cErrorHandler is used separately |
|
Limitation |
 n/a |
Logging the exception thrown during a client/server talk
This scenario applies only to Talend Open Studio for ESB, Talend Data Services Platform and Talend Data Fabric.
In this scenario, a Jetty server is started before a client browser requests access to it.
Then an exception is thrown at the server side and logged by cErrorHandler.
Dropping and linking the components
-
Drop the following components from the Palette onto the
workspace: cMessagingEndpoint, cErrorHandler and cProcessor, labelled as Jetty_Server, Error_Handler
and Throw_Exception respectively. -
Link cMessagingEndpoint and cProcessor using a Row >
Route connection.
Configuring the components
-
Double-click cErrorHandler to open its Basic settings view in the Component tab.
-
Select Logging Handler to log the exceptions that are
thrown. -
Double-click cMessagingEndpoint to open its Basic settings view in the Component tab.
-
In the Uri field, enter
jetty:http://localhost:8889/serviceto specify the Jetty
server. -
Click Advanced settings for
further setup.
-
In the Dependencies table, click the [+] button to add a line and select
jettyfrom the Camel
component list. -
Double-click cProcessor to
open its Basic settings view in the
Component tab.
-
In the Code box, enter
throw new Exception("serverto throw an exception.
side error") - Press Ctrl+S to save your Route.
Viewing code and executing the Route
-
Click the Code tab at the bottom of the design workspace
to check the generated code.
As shown above, the route startsfromthe endpointJetty_Server
and throws the exception ofserver side errorvia
cProcessor_1. -
Press F6 to execute the Route.
The Jetty server has started. -
Launch an Internet browser and enter
http://localhost:8889/service(the Jetty server URI
configured above) in the address bar to access the server.
As shown above, the request failed due to the server error. -
Go to the Studio and check the results in the Run
tab.
As shown above, cErrorHandler has logged the exception
at the level of ERROR.