Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.23.1
-
None
-
Unknown
Description
I have a simple route which runs by demand and archives multiple files in one zip archive.
from(file:/path/to/source) .aggregate(constant(1), new ZipAggregationsStrategy(true, true)) .completionFromBatchConsumer() .eagerCheckCompletion() .to(file:/path/to/target)
It works fine when the number of files in source folder is relatively small.
After adding tracing logs to test size of input files / time taken by process, the following chart could be drawn.
That means, to make zip archive from 500mb of files takes over 12 minutes!
Looks like in order to add a file, camel extracts zip archive to input stream, put file inside it, and build zip archive again. So that becomes near quadratic complexity, and not acceptable for large folders.
The workaround is to add completionSize or completionPredicate to flush every 100mb, so we got all files archived but splitted into several archives, which works but not the best choice.
Is there a general solution how to make ZipAggregationStrategy to work in near linear time, so the process does not become slower with large number of files?
Attachments
Attachments
Issue Links
- links to