This is the intended behavior. To achieve the behavior you want, I propose the followings: - use the file consumers Exchange property "CamelBatchComplete" [1] to know which file is the last one - use an Aggregator [2] with a custom completion Predicate before you are calling your "teaserService"
[1] http://camel.apache.org/file2.html [2] http://camel.apache.org/aggregator2.html Best, Christian ----------------- Software Integration Specialist Apache Member V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer Apache Incubator PMC Member https://www.linkedin.com/pub/christian-mueller/11/551/642 On Thu, Jul 3, 2014 at 5:25 PM, zzkozak <mar...@pikula.de> wrote: > I wrote the following route and expected that the bean 'teaserService' > should > be called only one time, at the end of processing of all files, but ... > it's > called after processing of each file: > > How to achieve such a behavior? > > Thanks > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-call-a-bean-after-all-files-has-been-processed-tp5753293.html > Sent from the Camel - Users mailing list archive at Nabble.com. >