Skip to main content Skip to complementary content

Configuring the second sub-route

Procedure

  1. Double-click the second cDirectVM component (labeled D-VM_consumer in this example) to display its Basic settings view on the Component tab.
  2. In the Endpoint Name field, enter dvm in double quotation marks to name the endpoint.
  3. Double-click the cProcessor (labeled Show_message in this example) component to display its Basic settings view.
  4. In the Code area, enter the following code to display the content of the message headers and the message body:
    exchange.getOut().setHeader("header1",exchange.getIn().getHeader("Name"));
    exchange.getOut().setHeader("header2",exchange.getIn().getHeader("Company"));
    exchange.getOut().setBody(exchange.getIn().getBody(String.class));
    System.out.println();
    System.out.println("Message for "+exchange.getOut().getHeader("header1")
    +" of "+exchange.getOut().getHeader("header2")+":");
    System.out.println(exchange.getOut().getBody(String.class));

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!