You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Edwin <ed...@gmail.com> on 2012/07/19 11:17:53 UTC

Question on Camel WireTap EIP custom thread pool creation

Hi Folks,

I'm currently researching how to create custom thread pools for wiretap
operations in my application.

I have multiple routes and for each route I want to have an individual
wiretap operation. The wiretap operation must run in a custom thread pool of
poolSize & maxPoolSize of 1, maxQueueSize = unbounded

I've started a couple of spikes to test my configuration however i'm
experiencing some unexpected behaviour.

When I analyse the thread pools that are getting created, I see a custom
thread pool for each route but I also see the wiretap default thread pool
being created for each route aswell

I'm wondering is there any way of configuring the wiretap operation to use
only the custom thread pool and not both the wiretap default thread pool and
custom thread pool?

Any insights into this issue are much appreciated

Thanks,
Edwin

My configuration looks like this:

              ThreadPoolProfile tpProfileOne= new
ThreadPoolProfile("tpProfileOne");
              tpProfileOne.setMaxPoolSize(1);
              tpProfileOne.setMaxQueueSize(-1);
              tpProfileOne.setPoolSize(1);

             
getContext().getExecutorServiceManager().registerThreadPoolProfile(
                           tpProfileOne);

              from("EndpointA").to(
                           "EndpointB").wireTap("EndpointC").threads()
                           .executorServiceRef("tpProfileOne")
                           .to("EndpointD");


--
View this message in context: http://camel.465427.n5.nabble.com/Question-on-Camel-WireTap-EIP-custom-thread-pool-creation-tp5716239.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Question on Camel WireTap EIP custom thread pool creation

Posted by wing-tung Leung <wi...@gmail.com>.
2012/7/20 Claus Ibsen <cl...@gmail.com>:
> Can you try with 2.10, I think there was a bug in wire tap custom
> thread pool, but it may only be when using XML DSL.
> But testing with latest release would be good.

Just for your information: I'm using the old Camel 2.6.0 with XML DSL,
and when I don't specify a custom threadpool reference, each wireTap
results into a separate threadpool. That might be the bug you are
referring to.

Explicitly linking wireTap elements to a custom threadpool works as advertised.

Have not tested the Java DSL variant.

Re: Question on Camel WireTap EIP custom thread pool creation

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jul 19, 2012 at 6:05 PM, Edwin <ed...@gmail.com> wrote:
> Thanks for your response Claus, I have removed the threads() however I still
> get the same behavior.
>
> I am using Camel version 2.9.2
>

Can you try with 2.10, I think there was a bug in wire tap custom
thread pool, but it may only be when using XML DSL.
But testing with latest release would be good.

And just to be sure you see 2nd thread pool. Can you double check its
for wire tap and not some kind of other pool?

> Thanks,
> Edwin
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Question-on-Camel-WireTap-EIP-custom-thread-pool-creation-tp5716239p5716259.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Re: Question on Camel WireTap EIP custom thread pool creation

Posted by Edwin <ed...@gmail.com>.
Thanks for your response Claus, I have removed the threads() however I still
get the same behavior.

I am using Camel version 2.9.2

Thanks,
Edwin

--
View this message in context: http://camel.465427.n5.nabble.com/Question-on-Camel-WireTap-EIP-custom-thread-pool-creation-tp5716239p5716259.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Question on Camel WireTap EIP custom thread pool creation

Posted by Claus Ibsen <cl...@gmail.com>.
Remove the threads() as thats another EIP that also uses a thread poo..

On Thu, Jul 19, 2012 at 11:17 AM, Edwin <ed...@gmail.com> wrote:
> Hi Folks,
>
> I'm currently researching how to create custom thread pools for wiretap
> operations in my application.
>
> I have multiple routes and for each route I want to have an individual
> wiretap operation. The wiretap operation must run in a custom thread pool of
> poolSize & maxPoolSize of 1, maxQueueSize = unbounded
>
> I've started a couple of spikes to test my configuration however i'm
> experiencing some unexpected behaviour.
>
> When I analyse the thread pools that are getting created, I see a custom
> thread pool for each route but I also see the wiretap default thread pool
> being created for each route aswell
>
> I'm wondering is there any way of configuring the wiretap operation to use
> only the custom thread pool and not both the wiretap default thread pool and
> custom thread pool?
>
> Any insights into this issue are much appreciated
>
> Thanks,
> Edwin
>
> My configuration looks like this:
>
>               ThreadPoolProfile tpProfileOne= new
> ThreadPoolProfile("tpProfileOne");
>               tpProfileOne.setMaxPoolSize(1);
>               tpProfileOne.setMaxQueueSize(-1);
>               tpProfileOne.setPoolSize(1);
>
>
> getContext().getExecutorServiceManager().registerThreadPoolProfile(
>                            tpProfileOne);
>
>               from("EndpointA").to(
>                            "EndpointB").wireTap("EndpointC").threads()
>                            .executorServiceRef("tpProfileOne")
>                            .to("EndpointD");
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Question-on-Camel-WireTap-EIP-custom-thread-pool-creation-tp5716239.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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