Skip to main content Skip to complementary content

Configuring the components

Procedure

  1. Double-click the first cFile component, which is labeled Read, to open its Basic settings view in the Component tab.
  2. In the Path field, enter or browse to the path to the source files, and leave the other parameters as they are.
  3. Repeat these steps to define the target folder in property settings of the second cFile component, which is labeled Write.
  4. Double-click the first cProcessor component, which is labeled Read_monitor, to open its Basics settings view in the Component tab.
  5. In the Code area, customize the code to display the time each message is read from the source:
    Date date=new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
    String s = formatter.format(date);
    System.out.println("\nMessage "+
    exchange.getIn().getHeader("CamelFileName")+
    " read at "+(s));
  6. Repeat these steps to configure the second cProcessor component, which is labeled Write_monitor, to display the time each message is written to the target:
    Date date=new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
    String s = formatter.format(date);
    System.out.println("Message "+
    exchange.getIn().getHeader("CamelFileName")+ " written at "+(s));
  7. Double-click the cDelayer component, which is labeled Delay_timer, to open its Basic settings view in the Component tab.
  8. In the Time to wait (in ms) field, enter the number of milliseconds by which you want to delay message delivery. Note that the value must be a positive integer.
    In this use case, each message needs to be delivered after a 20-second delay.
  9. 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!