title: Parallel processing of multiple files using Apache Camel
body: <p>I have thousands of files to process each individually. 
  I used Apache Camel to process the files</p>
  
  <p>from("file:C:\datafiles\input?readLock=changed&amp;readLockTimeout=100&amp;readLockCheckInterval=20")
  .process(new MyProcessor()).to("file:C:\datafiles\output");</p>
  
  <p>I do each file one at a time and it takes 30 minutes.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>When I searched the internet I got some suggestions like using </p>
  
  <ol>
  <li>maxMesssagesPerPoll </li>
  <li>threads(10) </li>
  <li>Aggregators</li>
  </ol>
  
  <p>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.</p>