You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by georgiosgeorgiadis <ge...@yahoo.co.uk> on 2010/03/03 19:37:02 UTC
Camel Mina Thread Pool Daemon mode
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)??
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.
Re: Camel Mina Thread Pool Daemon mode
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Fell free to create a ticket in JIRA and if possible submit a patch
and if possible including an unit test.
On Wed, Mar 3, 2010 at 7:37 PM, georgiosgeorgiadis
<ge...@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)??
>
> 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
Re: Camel Mina Thread Pool Daemon mode
Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Mar 3, 2010 at 7:37 PM, georgiosgeorgiadis
<ge...@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