You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "jeevan.koteshwara" <je...@gmail.com> on 2011/08/30 18:53:26 UTC

Reading multiple files at a time

Hi,
   I am trying read multiple files from a directory at a time within my
camel route.

E.g.

from(src).bean(abc.class).to(dest)

In the above route, source is a directory which would contain 2-3 files in
it. If I run this route, then camel will process one file at a time and will
route it to the destination. But, my requirement needs reading the contents
of all the files at a time (where I need to merge the contents form
different file, with some additional activities on the contents), so that in
my bean class, the camel Exchange object holds contents from all the files
within the source directory.

Is there any options to read the contents of all files at a single shot?

I did some google..but didnt get any clue.

Thanks and Regards,
Jeevan Mithyantha.



--
View this message in context: http://camel.465427.n5.nabble.com/Reading-multiple-files-at-a-time-tp4750809p4750809.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Reading multiple files at a time

Posted by Mathieu Lalonde <mr...@live.ca>.
Hi Jeevan,

It sounds like you need the Aggregator Enterprise Integration Pattern (EIP).
http://camel.apache.org/aggregator.html

Cheers,
Mathieu

----------------------------------------
> Date: Tue, 30 Aug 2011 09:53:26 -0700
> From: jeevan.koteshwara@gmail.com
> To: users@camel.apache.org
> Subject: Reading multiple files at a time
>
> Hi,
> I am trying read multiple files from a directory at a time within my
> camel route.
>
> E.g.
>
> from(src).bean(abc.class).to(dest)
>
> In the above route, source is a directory which would contain 2-3 files in
> it. If I run this route, then camel will process one file at a time and will
> route it to the destination. But, my requirement needs reading the contents
> of all the files at a time (where I need to merge the contents form
> different file, with some additional activities on the contents), so that in
> my bean class, the camel Exchange object holds contents from all the files
> within the source directory.
>
> Is there any options to read the contents of all files at a single shot?
>
> I did some google..but didnt get any clue.
>
> Thanks and Regards,
> Jeevan Mithyantha.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Reading-multiple-files-at-a-time-tp4750809p4750809.html
> Sent from the Camel - Users mailing list archive at Nabble.com.