Procedure
-
Double-click Read_Output to open its
Basic settings view in the Component tab.
- In the Path field, type in the path to the source message, for example, "E:/data/output". Keep the default settings for other fields.
-
Double-click cThrottler to open its
Basic settings view in the Component tab.
-
In the Request per period field, type in
the number of messages allowed to pass the throttler per period, for
example, 1.
In the Set time period field, type in the value of the period, for example, 8000.
-
Double-click Print_File_Name to open its
Basic settings view in the Component tab.
-
In the Code box, enter the code below to
get the name of the message that passes the throttler.
System.out.println("The file that passes throttler is: "+exchange.getIn().getHeader("CamelFileName"));
-
Double-click Print_File_Content to open
its Basic settings view in the Component tab.
-
In the Code box, enter the code below to
get the content of the message that passes the throttler.
System.out.println("The content of " +exchange.getIn().getHeader("CamelFileName")+ " is: " +exchange.getIn().getBody(String.class));
- Press Ctrl+S to save your Route.