On 7/27/07, larry hughes <[EMAIL PROTECTED]> wrote:
>
> I would like to understand how the configuration of the thread pool in
> Servicemix works with respect to the components in the service assembly.
> Suppose I configure servicemix like this:
>
> ---------------------------------------
> servicemix.corePoolSize = 1
> servicemix.maximumPoolSize = 1
> servicemix.queueSize = 128
> --------------------------------------
>
> Now I've deployed a service assembly which contains 4 components-- 1)
> filepoller, 2) xslt, 3) lw component, 4) bridge.  The filepoller polls and
> sends files to the bridge.  The bridge first sends it to the xslt component
> for transformation, then sends this transformed document to the lw component
> which does its thing.
>
> Since there is only 1 thread configured, will servicemix create four
> threads, one for each component, i.e. 1 for file poller, 1 for xslt, 1 for
> bridge, and 1 for lw, or is this 1 thread for the entire service assembly,
> i.e. filepoller gets the thread and needs to finish, then the thread is
> allocated for the bridge, and so on?  And how does the queueSize fit into
> all of this?

Each flow in ServiceMix (the JCAFlow, AbstractJMSFlow and SedaQueue
classes) uses an executor to create a new thread each time a message
exchange is enqueued. Further, as the page about thread pools
(http://incubator.apache.org/servicemix/thread-pools.html) explains
near the bottom:

When the executor receives a new task, the following happen:

* if the number of threads is less than corePoolSize, the executor
will create a new thread to handle the job
* if the number of queued jobs is less than queueSize, the job is queued
* if the queue is full and the number of threads is less than
maximumPoolSize, a new thread is created to handle the job
* else, the current thread will handle the job

Bruce
-- 
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Reply via email to