consume all files in Apache Camel pollEnrich

615 views Asked by At

Is there any way or property in pollEnrich which helps us to consume all files at once? I can't use from because it's already being used for timer. 2 from are not allowed in a single route.

Here is my code:

from("timer://foo")
.pollEnrich("file:src")
.aggregate(new ZipAggregationStrategy()).constant(false)
.completionFromBatchConsumer().eagerCheckCompletion()
.setHeader(Exchange.FILE_NAME, simple("file"+".zip"))
.to("file:src/test/java/out");

I want the all files in src to be zipped in a folder. But pollEnrich is consuming file one at a time, which is causing problem.

0

There are 0 answers