Configuring the components - 6.4

Aggregate - Mediation

author
Talend Documentation Team
EnrichVersion
6.4
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
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)
EnrichPlatform
Talend Studio

Procedure

  1. Double-click the cFile component, which is labelled 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 labelled 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 labelled 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 labelled 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.