Creating a Route - 8.0

Data Service and Routing Examples

Version
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development > Designing Routes
Design and Development > Designing Services
Last publication date
2023-12-08
To show an example of Unit testing, we will create a Route first. This Route reads a file from the specific directory and filters the messages of the file.

Procedure

  1. Drag and drop a cFile, a cConvertBodyTo, a cMessageFilter and a cMessagingEndpoint from the Palette onto the design workspace.
    Screenshot of the Job in the design workspace.
  2. Label the components for better identification of their roles. Link the cMessageFilter component and the cMessagingEndpoint component using the Row > filter connection. Link the other components as shown above using the Row > Route connection.
  3. Double-click the cFile component to open its Basic settings view in the Component tab and configure it as shown below to read files from a local file system.
    Basic settings view.
  4. Double-click the cConvertBodyTo component to open its Basic settings view in the Component tab and configure it as shown below to convert the message body of each file into String type.
    Basic settings view.
  5. Double-click the cMessageFilter component to open its Basic settings view in the Component tab and configure it as shown below to filter the message body based on the expression:
    ${body} contains 'bar'
    Basic settings view.
  6. Double-click the cMessagingEndpoint component to open its Basic settings view in the Component tab and configure it as shown below to log the output of the Route.
    Basic settings view.
  7. In the Run view, click the Run button to launch the execution of your Route. The data that matches the filtering criterion is displayed in the console.
    Screenshot of the console results after successfully running the Job.

Results

For more information on how to create a Route, see Creating a Route.