1 Reply Latest reply on Aug 18, 2012 3:25 AM by davsclaus

    Why File Pooler doesn't creates new threads?

    mikek753_michael.korolyov

      Hi,

       

      I have:

      from("file:" + importDir + importOpts)

      .beanRef("aBean");

       

      the directory has above 100 files, however I don't see any more threads from this File Producer.

      As  importOpts I have "/?noop=true".

      Yes, I see multiple camelLocks while it run, but only single thread as result.

      Is the a way to enable multiple threads?

      In JMX I see that pool number is 1 and maxPool is 10 for this File Consumer.

       

      I tried to add

      .threads(1,10)

      but, again got only 1 extra thread in new pool.

      1 thread in File Pool and 1 thread my new pool

      when I set

      .threads(10,100)

      I got 10 threads that runs in parallel to process incoming Files

       

      Why "file:" doesn't create multiple threads?

      Why "threads()" doesn't increase number of threads?

       

      What's criteria that increases number of threads in the pool? To get more then min threads.

       

      thanks.

        • 1. Re: Why File Pooler doesn't creates new threads?
          davsclaus

          Hi

           

          The file consumer is single threaded, which most consumers are. Some have special options for concurrency such as SEDA or JMS.

           

          The threads EIP allows you to leverage concurrency with a backing thread pool.

           

          Read some details at

          http://camel.apache.org/threading-model.html

           

          If you have a copy of the Camel in Action book then chapter 10 covers this in much more details.

           

          And the thread pool which are used are from the JDK. So there should be plenty of docs and books out there about them. The JDK thread pools is not very aggressive, and that is why (1, 10) uses 1 thread, and only grows when the worker queue is full. You can configure the worker queue to a lower size.