You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2012/02/22 15:38:28 UTC

[DISCUSS] - Background thread pool for multiplexed tasks

Hi

In Camel we can have a number of background tasks that run
periodically if you use different components and EIPs etc.
For example we may have background tasks to check for timeouts,
inactivity, a JMX average stats task etc.
Currently many of these tasks use their own scheduled thread pool with
1 thread. An example is the TimeoutMap implementation.

We may wonder if we could add support for a shared thread pool where
you can enlist/remove tasks to be scheduled. Then the idiom would be
that your task must be
- short lived
- not process messages etc.
- not be 100% real-time

Then we can use a single multiplexed thread that executes these tasks.
Often the tasks is indeed short lived, as they just check for
inactivity, or for example for the Aggregator EIP they may move
Exchanges which are timeout from an internal Map into another thread
pool for further processing.

Then we can have a fairly simple API for EIPs, and components, to
enlist such short-lived background tasks.




-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/