I tried your code It did not work 

here is my actual code



public class MyRouteBuilder extends RouteBuilder {

        
    public void configure() {
        from("file://e:/u01/oracle/NEW_NEAR_FILES/?delete=true&delay=60000")
                        .convertBodyTo(File.class)
                
//.aggregate(constant(true)).completionFromBatchConsumer().groupExchanges()
                
.aggregate(constant(true)).completionSize(10).completionTimeout(10000L).groupExchanges()
 
                        .process(new FileProcessor())
        .to("file:/u01/oracle/PROCESSED_NEAR_FILES")
        ;

    }

    public static class FileProcessor implements  Processor {
                @Override
                public void process(Exchange exchange) throws Exception {
                        System.out.println("from process");
                        ArrayList<Exchange> grouped =
exchange.getProperty(Exchange.GROUPED_EXCHANGE, ArrayList.class); 
                        for(Exchange exch :grouped){
                                File file=exch.getIn().getBody(File.class);
                                System.out.println("name"+file.getName());
                        }
                }
    }
}




using 
.aggregate(constant(true)).completionFromBatchConsumer().groupExchanges()

my FileProcessor  is not called and If I replace this with 
.aggregate(constant(true)).completionSize(10).completionTimeout(10000L).groupExchanges()
 

the processor is called, is there anything wrong with 
.aggregate(constant(true)).completionFromBatchConsumer().groupExchanges()




--
View this message in context: 
http://camel.465427.n5.nabble.com/read-all-files-in-folder-tp4474104p4477142.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to