Configuring the components and connections - 7.3

Filter (Mediation)

author
Talend Documentation Team
EnrichVersion
Cloud
7.3
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) > Filter components (Mediation)
Data Quality and Preparation > Third-party systems > Routing components (Mediation) > Filter components (Mediation)
Design and Development > Third-party systems > Routing components (Mediation) > Filter components (Mediation)
EnrichPlatform
Talend Studio

Procedure

  1. Double-click the cFile component, which is labelled Source, to display its Basic settings view in the Component tab.
  2. In the Path field, specify the file path to the message source.
    From the Encoding list, select the encoding type of your source files, and leave all the other parameters as they are.
  3. Double-click the cIdempotentComsumer component, which is labelled Deduplicator, to display its Basic settings view in the Component tab.
  4. From the Repository Type list, select between Memory and File to specify where the message identifiers will be stored before the deduplication process. For this scenario, select File.
    In the File store field, specify the location of the file storing message identifiers.
    In the Expression field, enter an expression to filter the messages. In this scenario, enter the following expression to filter the messages according to the person node of the XML files: xpath("/people/person"), and leave all the other parameters as they are. Alternatively, you can select the Use language check box, select XPath from the Language list, and enter "/people/person" in the Predicate field.
  5. Double-click the cProcessor component labelled Unique to display its Basic settings view in the Component tab.
  6. In the Code area, customize the code to display the file name of the message that passes the deduplication:
    System.out.println("Message consumed on Unique: "+
    exchange.getIn().getHeader("CamelFileName"));
  7. Repeat these steps to configure the other cProcessor component, which is labelled All, to display the file names of all the messages coming from the source:
    System.out.println("Message consumed on All: "+
    exchange.getIn().getHeader("CamelFileName"));
  8. Press Ctrl+S to save your Route.