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

About this task

The cMessageRouter component does not have any property as it filters and routes the messages from one endpoint to others based on the conditions set in its When connection(s).

Procedure

  1. Double-click the cFile component labeled Sender to open its Basic settings view in the Component tab.
  2. In the Path field, specify the file path to message source.
    From the Encoding list, select the encoding type of your message files. Leave the other parameters as they are.
  3. In the design workspace, click the When connection you created and click the Component view to define a filter against which messages will be routed.
  4. In the Type list, select xpath because the format of the messages used is XML.
    In the Condition field, type in "/person[city='Paris']" to retrieve only those messages in which the value of the city node is Paris.
  5. Double-click the cMessagingEndpoint component labeled directParis to open its Basic settings view in the Component tab.
  6. In the URI field, enter the endpoint URI, for example, "direct:Paris" to receive the filtered message.
  7. Repeat these steps to set the endpoint URI of the cMessagingEndpoint components labeled directOthers as "direct:Others". Set the endpoint URIs of the cMessagingEndpoint components labeled directParisRoute and directOthersRoute as "direct:Paris" and "direct:Others" respectively.
  8. Double-click the cFile component labeled Receiver_Paris to open its Basic settings view in the Component tab, and specify the path for the messages meeting the filter criterion in the Path field.
    Repeat this step to define the path for all the other messages from the sender in the cFile component labeled Receiver_Others.
  9. Double-click the cLog component labeled Monitor_Paris to open its Basic settings view in the Component tab.
  10. Select INFO in the Level list. Select the Specify output log message option and enter the following code in the Message field to display the filename of the message sent to the specified directory.
    Message sent to folder Paris_only: ${header.CamelFileNameOnly}
    Repeat this step to customize the message in the cLog component labeled Monitor_Others to display the filename of the message sent to the specified directory.
  11. Press Ctrl+S to save your Route.