I have thousands of files to process each individually. I used Apache Camel to process the files
from("file:C:\datafiles\input?readLock=changed&readLockTimeout=100&readLockCheckInterval=20") .process(new MyProcessor()).to("file:C:\datafiles\output");
I do each file one at a time and it takes 30 minutes.
I'm thinking I can do this processing in 10 simultaneous threads, 10 files at a time, and I might be able to do it in 3 minutes instead of 30.
My question is, what is the "correct" way to achieve my 10 threads? And when one is done, create a new one to a max number of 10.
When I searched the internet I got some suggestions like using
- maxMesssagesPerPoll
- threads(10)
- Aggregators
But I do not have anything to do with Aggregators here, just need to process each file from one remote location, process it and then place them in another remote location.