tRouteFault
message as fault.
tRouteFault Standard properties
These properties are used to configure tRouteFault running in the Standard Job framework.
The Standard
tRouteFault component belongs to the ESB family.
This component is relevant only when used with one of the
Talend
solutions with ESB, as it should be used with the Service Repository node and the Data Service creation related wizard(s).
Basic settings
Output Schema and Edit |
A schema is a row description. It defines the number of fields Click Edit
Click Sync columns to retrieve |
 |
Built-in: No property data stored |
 |
Repository: Select the Repository |
Camel |
Enter the message parameters corresponding to the columns you |
Type |
Select between:
Body: Used to set the body of a
Property: Used to set the
System: Used to set the system
Header: Used the set the output |
Name |
This column is used to set the name for the parameter when its |
Advanced settings
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at a |
Global Variables
Global Variables |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component can be used as the end component and thus requires |
Limitation |
The Job using a tRouteFault must |
Exchanging messages between a Job and a Route
This scenario applies only to Talend Open Studio for ESB, Talend Data Services Platform and Talend Data Fabric.
This scenario describes how to exchange messages between a Job and a Route using the
tRouteInput and the tRouteFault component. To do this, a Job is created to receive the
message from the Route and mark the message as fault. Then a Route is built to send the
message to the Job and handle the fault message.
Creating an Data Integration Job
In this section, a Job named RouteCommunication_tRouteFault is
built.
Arranging the
flow of the
message

-
Drag and drop a tRouteInput and a
tRouteFault from the Palette onto the design workspace. -
Right-click the tRouteInput component,
select Row > Main from the contextual menu and click the tRouteFault component.
Configuring how the
message is
processed
-
Double-click the tRouteInput
component to open its Basic settings
view in the Component tab. -
Click the three-dot button next to Edit
Schema. In the schema dialog box, click the plus button
to add a new line ofString
type and name it
body. Click OK
to close the dialog box. -
In the Simple Expression field for
the body element, enter"${in.body}"
to get the body of the input message from the Route. -
Double-click the tRouteFault
component to display its Basic settings
view in the Component tab. -
Make sure that tRouteFault has one
element body. Set its type to Body. - Press Ctrl+S to save your Job.
Creating a Mediation Route
In this section, we will create a Route to send a message to the Job and handle the fault
message.
Dropping and linking the components

- Drag and drop a cTimer, a cSetBody, a cJavaDSLProcessor, a cTalendJob, a cOnException and a cProcessor component from the Palette onto the design workspace.
-
Link the components with the Row >
Route connection as shown
above. - Label the components for better identification of their roles.
Configuring the components
-
Double-click the cTimer component to
open its Basic settings view in the
Component tab. -
Enter 1 in the Repeat field to trigger a message exchange one
time. -
Double-click the cSetBody component
to display its Basic settings view in
the Component tab. -
Select Simple from the Language list and enter
Hello! in the Expression field. -
Double-click the cJavaDSLProcessor
component to open its Basic settings
view in the Component tab. -
Enter .handleFault() in the Code box so that the fault message will be caught as an
exception. -
Double-click the cTalendJob component
to display its Basic settings view in
the Component tab. -
Select Job RouteCommunication_tRouteFault from
the repository to call the Job that is created in the previous
section. -
Double click the cOnException
component to display its Basic settings
view in the Component tab. -
Click [+] to add a line to the
Exceptions table, and enter
org.apache.camel.CamelException in the
Exception field to handle the
exceptions. -
Double-click the cProcessor component
to display its Basic settings view in
the Component tab. -
Customize the code in the Code area
to show the message body:1System.out.println(exchange.getIn()); -
Press Ctrl+S to save your
Route.
Executing the Route
Click the Run view to display it and click
the Run button to launch the execution of your
Route. You can also press F6 to execute it.
The message Hello! is sent from the Route to the Job and
caught as exception:
