Hi there,

Firstly, congrats on Camel. I've been using other ESBs and I'm really liking
the way this one hangs together.

However, I have a problem and after lots of trawling I've not been able to
sort this one for myself.

I'm wanting to read a bunch of files from a directory and then aggregate all
of the files into a collection and then process that collection.

How to do this?

Here's my config so far:


        from(
                        
"file://target/classes/timetables?noop=true&consumer.recursive=true")
                        .aggregator(new AggregationCollection(constant(true),
this)).constant(true)
                        .process(new Processor() {
                                public void process(Exchange e) {
                                        System.out.println("Received exchange: 
" + e.getIn());
                                }
                        });


... and my strategy looks like:


        public Exchange aggregate(Exchange arg0, Exchange arg1) {
                return arg1;
        }


Now, I know my strategy doesn't make sense (nor my config either), but I'm
not quite sure what to do about a strategy here. My goal is simple enough:
simply collect all of the files.

Help!

Kind regards,
Christopher
-- 
View this message in context: 
http://www.nabble.com/How-to-use-Aggregator-and-AggregationCollection--tp19739918s22882p19739918.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to