Hi

You can use the max messages per poll to limit the number of files
which could allow the consumer to process files sooner.

On Tue, Feb 24, 2015 at 12:32 PM, Dewitte P-Alban <dewitte...@gmail.com> wrote:
> Hi everybody
>
> Is it possible to read recursively a directory and output file names
>  (and/or content) in a streamList like the outputytpe paramater for the
> JDBC component.
>
> I had to process large directories with many file. Right now my route
> recurse in all sub directories before starting to process each file. i
> would like to find a solution to start processing file right after file
> componant find it.
>
> Here is a example :
>
> public class FileScan {
>
>     public static void main(String[] args) throws Exception {
>
>
>         FileScan example = new FileScan();
>         example.boot();
>     }
>
>     public void boot() throws Exception {
>         // create a Main instance
>         Main main = new Main();
>         // enable hangup support so you can press ctrl + c to terminate the 
> JVM
>         main.enableHangupSupport();
>         main.addRouteBuilder(new RouteBuilder() {
>             @Override
>             public void configure() throws Exception {
>                 from("file:C:\\Temp?noop=true&recursive=true&readLock=none")
>                         .routeId("FileScanner").process(new Processor() {
>                     @Override
>                     public void process(Exchange exchange) throws Exception {
>                         System.out.println("Reading
> "+exchange.getIn().getHeader("CamelFilePath"));
>                     }
>                 });
>             }
>         });
>
>         // run until you terminate the JVM
>         System.out.println("Starting Camel. Use ctrl + c to terminate
> the JVM.\n");
>         main.run();
>     }
>
> }
>
> Best regards
>
> Pierre-Alban



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to