August 17, 2023

tRouteInput – Docs for ESB 5.x

tRouteInput

tRouteInput_icon32_white.png

tRouteInput properties

Warning

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

Component family

ESB/Route

 

Function

tRouteInput accepts messages from
a Route.

Purpose

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

Basic settings

Input Schema and Edit
schema

A schema is a row description. It defines the number of fields 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.

 

 

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 using the Simple Expression
Language.

For more information about the Simple Expression Language, see the
site http://camel.apache.org/simple.html.

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 starter component and has an
output. It is mandatory that a tRouteInput component is used in the Data
Integration Job to be called by a Route using the cTalendJob component. The reason for it
is that this will prevent the referenced Job from starting
automatically when deployed in Talend Runtime. Instead it will only
start when it gets called by the Route. For more information about
how to use the cTalendJob
component, see Talend ESB Mediation Components Reference Guide.

Limitation

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

Scenario: Getting messages from a Route

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

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 accept the message from a Route.

Dropping and linking the components
use_case_trouteinput1.png
  1. Drag and drop a tRouteInput and a
    tLogRowfrom the Palette onto the design workspace.

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

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

    use_case_trouteinput2.png
  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.

    use_case_trouteinput3.png
  3. In the Simple Expression field for
    the body element, enter "${in.body}"
    to get the body of the input message from the Route.

  4. The tLogRow component will monitor
    the message exchanges and does not need any configuration.

  5. 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 send the message to the Job.

Dropping and linking the components
use_case_trouteinput4.png
  1. Drag and drop a cMessagingEndpoint, a
    cSetBody, and a cTalendJob 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.

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

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

    use_case_trouteinput5.png
  4. Select Simple from the Language list and enter Hello!
    in the Expression field.

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

    use_case_trouteoutput7.png
  6. Select Job RouteCommunication from the
    repository.

  7. 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:

use_case_trouteinput6.png

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x