Skip to main content Skip to complementary content

Configuring the components

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.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!