If three files are in same directory, you can just use one route with the aggregator. If these files are in different directory, you can use three route like this
from("file:/csv1/").to("direct:merge"); from("file:/csv2/").to("direct:merge"); from("file:/csv3/").to("direct:merge"); from("direct:merge").aggregate(…) -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, March 19, 2013 at 5:12 AM, Pontus Ullgren wrote: > Hello, > > The file component will by default poll all files that are available > in the directory. > You could then use the aggregator EIP [1] and your own custom > aggregation strategy to combine the files. > > Possibly you could also use a custom route policy to restrict the > polling of files until all files are available. > > [1] http://camel.apache.org/aggregator2.html > > Just my $0.02 > // Pontus > > On Mon, Mar 18, 2013 at 10:42 AM, Joe San <codeintheo...@gmail.com > (mailto:codeintheo...@gmail.com)> wrote: > > Camel Users, > > > > I need to acheive the following scenario: > > > > I have a file system where 3 different CSV files will be written, csv1, > > csv2 and csv3. All these 3 files will be available at the same time. I need > > to read all the three files, do some processing on iut and produce one CSV > > file as a result. > > > > The question that I have here is, do I need to know the name of the csv > > files in advance to read them from the file system? or is there a way to > > read multiple files at once and get the file contents from the file name > > where the file name is available as a header? > > > > Regards, > > Joe >