tRouteOutput - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

tRouteOutput properties

Warning

This component is available only to users of Talend Studio with ESB.

Component family

ESB/Route

 

Function

tRouteOutput sends messages from a Job to a Route.

Purpose

tRouteOutput allows you to exchange messages between a Data Integration Job and a Mediation Route.

Basic settings

Output Schema

A schema is a row description. It defines the number of fields (columns) to be processed and passed on to the next component. The schema is either Built-In or stored remotely in the Repository.

Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this option to view the schema only.

  • Change to built-in property: choose this option to change the schema to Built-in for local changes.

  • Update repository connection: choose this option to change the schema stored in the repository and decide whether to propagate the changes to all the Jobs upon completion. If you just want to propagate the changes to the current Job, you can select No upon completion and choose this schema metadata again in the [Repository Content] window.

Click Sync columns to retrieve the schema from the previous component connected in the Job.

 

 

Built-in: No property data stored centrally.

 

 

Repository: Select the Repository file where Properties are stored.

 

Camel

Enter the message parameters corresponding to the columns you defined in the schema dialog box via the Edit schema button.

 

Type

Select between:

Body: Used to set the body of a Route, equals the code exchange.getOut().setBody(...).

Property: Used to set the property of a Route, equals the code exchange.setProperty(name, value).

System: Used to set the system property, equals the code System.setProperty(name, value).

Header: Used the set the output header, equals the code exchange.getOut().setHeader(name, value).

 

Name

This column is used to set the name for the parameter when its type is either Property, System or Header. This column is ignored when the type is Body.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a Job level as well as at each component level.

Global Variables 

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage

This component can be used as the end component and thus requires an input component.

Limitation

The Job using a tRouteOutput must be launched only within a Route using the cTalendJob component.

Scenario: Getting messages from tRouteOutput

This scenario describes how to send messages from a Job to a Route using the tRouteOutput component. To do this, we need to build a Job to send the message and then create a Route using the cTalendJob component to call the Job and receive the message.

For more information about how to use the Mediation components, see Talend ESB Mediation Components Reference Guide.

Creating an Data Integration Job

In this section, we will build a Job named RouteCommunication to send the message to a Route.

Dropping and linking the components
  1. Drag and drop a tFixedFlowInput and a tRouteOutput from the Palette onto the design workspace.

  2. Right-click the tFixedFlowInput component, select Row > Main from the contextual menu and click the tRouteOutput component.

Configuring the components
  1. Double-click the tFixedFlowInput component to open its Basic settings view in the Component tab.

  2. Click the three-dot button next to Edit Schema. In the schema dialog box, click the plus button to add a new line of String type and name it body. Click OK to close the dialog box.

  3. In the Number of rows field, set the number of rows as 1.

  4. In the Mode area, select Use Single Table and input the following request in double quotation marks into the Value field:

    Hello from Talend Job!

  5. Double-click the tRouteOutput component to display its Basic settings view in the Component tab.

  6. Make sure that tRouteOutput has one element body. Set its type to Body.

  7. Press Ctrl+S to save your Job.

Creating a Mediation Route

In this section, we will switch to the Mediation perspective and create a Route to receive the message sent from the Job.

Dropping and linking the components
  1. Drag and drop a cMessagingEndpoint, a cTalendJob, and a cLog component from the Palette onto the design workspace.

  2. Link the components with the Row > Route connection as shown above.

  3. Label the components for better identification of their roles.

Configuring the components
  1. Double-click the cMessagingEndpoint component to open its Basic settings view in the Component tab.

  2. In the URI field, enter "timer://myTimer?period=2000" to start message exchanges every 2000 milliseconds.

  3. Double-click the cTalendJob component to display its Basic settings view in the Component tab.

  4. Select Job RouteCommunication from the repository.

  5. The cLog component will monitor the message exchanges and does not need any configuration.

  6. 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. In the execution log you will see: