camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel Mina Thread Pool Daemon mode
Date Thu, 04 Mar 2010 13:03:10 GMT
On Wed, Mar 3, 2010 at 7:37 PM, georgiosgeorgiadis
<georgiosgeorgiadis@yahoo.co.uk> wrote:
>
> Hello,
>
> We decided to upgrade Apache Camel from version 1.6.2 to the latest stable
> 2.2.0.
> What we immediately noticed is that all our
> "from("mina:tcp://....."
> routings started exiting immediately (tcp ports closing) and they used to
> keep on listening in older versions. After I dag a little bit inside the
> MinaComponent class, I found out that after Camel version 2.1.0 the mina
> SocketAcceptor is implemented using a cached thread pool executor service:
>
> IoAcceptor acceptor = new SocketAcceptor(processorCount,
> ExecutorServiceHelper.newCachedThreadPool("MinaSocketAcceptor", true));
>
> instead of
>
> IoAcceptor acceptor = new SocketAcceptor(); which was using a single running
> Thread prior to 2.1.0.
>
> Currently the isDaemon flag is hard coded to be true in this class, which
> means that these threads cannot keep the VM alive if the main VM thread has
> returned. Is it possible that this flag (isDaemon) in the MinaComponent be
> made configurable via options (preferably in the routing uri)??
>

Well the idea is that your main class should only return when you app
is really shutting down.
So I actually advice you to let your main method keep running.

You can for example leverage MainSupport from camel-core, or simply
just Main from camel-spring.
For example Main from camel-spring supports using ctrl + c to shutdown.



> Thank you in advance.
>
> best regards
>
> Georgios
> --
> View this message in context: http://old.nabble.com/Camel-Mina-Thread-Pool-Daemon-mode-tp27771974p27771974.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message