Configuring the components - 7.0

Multicast - Mediation

EnrichVersion
7.0
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
EnrichPlatform
Talend Studio
task
Data Governance > Third-party systems > Routing components (Mediation) > Multicast components (Mediation)
Data Quality and Preparation > Third-party systems > Routing components (Mediation) > Multicast components (Mediation)
Design and Development > Third-party systems > Routing components (Mediation) > Multicast components (Mediation)

Procedure

  1. Double-click the cFile component labeled Source_file to open its Basic settings view in the Component tab.
  2. In the Path field, fill in or browse to the path where the source file Hello.txt is located. Keep the default settings for other fields.
  3. Double-click the cMulticast component labeled Multicast to open its Basic settings view in the Component tab.
  4. In the URIS table, click the plus button to add two lines and specify the URIs of the endpoints where the message will be sent, "direct:a" and "direct:b" in this use case.
  5. Double-click the cMessagingEndpoint component labeled direct_a to open its Basic settings view in the Component tab.
  6. In the URI field, enter the endpoint URI, "direct:a" in this use case.
    Repeat this step to set the endpoint URI for direct_b as "direct:b".
  7. Double-click the cProcessor component labeled Monitor_source to open its Basic settings view in the Component tab.
  8. In the Code box, enter the code below to print the source message in the console.
    System.out.println("The source message is: " + exchange.getIn().getBody(String.class));
    Repeat this step to customize the code of Monitor_endblock, Monitor_direct_a, and Monitor_direct_b as shown below to print the message of each endpoint.
    Monitor_endblock:
    System.out.println("The endblock message is: " + exchange.getIn().getBody(String.class));
    Monitor_direct_a:
    System.out.println("direct a just downloaded: "+exchange.getIn().getBody(String.class));
    Monitor_direct_b:
    System.out.println("direct b just downloaded: "+exchange.getIn().getBody(String.class));
  9. Double-click the cSetBody component labeled Set_new_body to open its Basic settings view in the Component tab.
  10. Select SIMPLE in the Language list.
    In the Expression field, enter "New message" as the new message body.
    Repeat this step to set the message body for direct:a and direct:b as "message A" and "message B" respectively.
  11. Press Ctrl+S to save your Route.