Configuring the components - Cloud - 8.0

Aggregate (Mediation)

Version
Cloud
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Routing components (Mediation) > Aggregate components (Mediation)
Data Quality and Preparation > Third-party systems > Routing components (Mediation) > Aggregate components (Mediation)
Design and Development > Third-party systems > Routing components (Mediation) > Aggregate components (Mediation)
Last publication date
2024-02-21

Procedure

  1. Double-click the cFile component, which is labeled File_source, to display its Basic settings view in the Component tab.
  2. In the Path field, browse to or enter the input file path, and leave the other parameters as they are.
    In this scenario, there are four text files in the specified directory: a.txt, b.txt, c.txt and d.txt, the contents of which are This is a!, This is b!, This is c!, and This is d! respectively.
  3. Double-click the cAggregate component, which is labeled Aggregator, to display its Basic settings view in the Component tab.
  4. In the Language field, select Constant or Simple as the expression language.
    In the Expression field, enter the expression "getBody(String.class)" to retrieve the body of the message.
    In the Strategy field, enter the name of the Java bean AggregateBody you just created.
    Select the Number of messages check box and type in 2 in the field.
  5. Double-click the cProcessor component labeled Monitor_before to display its Basic settings view in the Component tab.
  6. In the Code box, customize the code as follows so that the Run console displays the message contents before an aggregation takes place:
    System.out.println("Before aggregation: "+
    exchange.getIn().getBody(String.class));
  7. In the same way, configure the cProcessor component labeled Monitor_after so that the Run console displays the message contents after an aggregation takes place:
    System.out.println("After aggregation: "+
    exchange.getIn().getBody(String.class));
  8. Press Ctrl+S to save your Route.