You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by billy ding <di...@gmail.com> on 2012/07/23 02:54:31 UTC

Add thread pool configuration for SEDA using xml

Hi, from http://camel.apache.org/seda.html, we can use DSL to add thread pool
to SEDA, e.g. from("seda:stageName").thread(5).process(...), 
can anyone tell me how to do the same thing using xml? 
I have a xml seda route definition.
<camel:from uri="seda:asyncAuthenticate" />
<camel:to uri="bean:authenticateBean?method=performIndempotentOperations" />

Thanks a lot.
Billy



--
View this message in context: http://camel.465427.n5.nabble.com/Add-thread-pool-configuration-for-SEDA-using-xml-tp5716324.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Add thread pool configuration for SEDA using xml

Posted by billy ding <di...@gmail.com>.
Hi William,

Thanks for your reply.

Maybe I didn't describe my question clearly.

>From seda spec, it says "As for the difference between the two (Concurrent
consumers and thread pool), note a thread pool can increase/shrink
dynamically at runtime depending on load, whereas the number of concurrent
consumers is always fixed."
and we can use "from("seda:stageName").thread(5).process(...)" to configure
the thread pool for seda via DSL, so I think using DSL can make seda threads
number increase/shrink dynamically, which means it doesn't have to always be
5 concurrent consumers.
However, if you use xml, I only we can configure concurrentConsumers which
has fixed number threads (e.g. always 5 concurrent consumers), but I don't
know how to make the same effect using xml as DSL
"from("seda:stageName").thread(5).process(...)". Can someone shed some light
on this?



--
View this message in context: http://camel.465427.n5.nabble.com/Add-thread-pool-configuration-for-SEDA-using-xml-tp5716324p5716536.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Add thread pool configuration for SEDA using xml

Posted by Willem Jiang <wi...@gmail.com>.
Once you specify the seda endpoint with the URI, you cannot change the setting.

If you want to change the endpoint setting of route dynamically, you
need to stop the route first and add a new route with the new
configuration then.

On Thu, Jul 26, 2012 at 9:01 AM, billy ding <di...@gmail.com> wrote:
> Hi Claus,
>
> Thanks for your reply.
>
> So can we conclude, if we use xml configuration for seda, we can't have a
> thread pool which can increase/shrink dynamically at runtime, is that right?
>
> Thanks.
> Billy
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Add-thread-pool-configuration-for-SEDA-using-xml-tp5716324p5716494.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Add thread pool configuration for SEDA using xml

Posted by billy ding <di...@gmail.com>.
Hi Claus,

Thanks for your reply.

So can we conclude, if we use xml configuration for seda, we can't have a
thread pool which can increase/shrink dynamically at runtime, is that right?

Thanks.
Billy



--
View this message in context: http://camel.465427.n5.nabble.com/Add-thread-pool-configuration-for-SEDA-using-xml-tp5716324p5716494.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Add thread pool configuration for SEDA using xml

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Jul 23, 2012 at 2:54 AM, billy ding <di...@gmail.com> wrote:
> Hi, from http://camel.apache.org/seda.html, we can use DSL to add thread pool
> to SEDA, e.g. from("seda:stageName").thread(5).process(...),

This is not really possible. Please read the docs again.
The seda has its own internal fixed thread pool, you cannot
re-configure. You set the option concurrentConsumers=5 on the seda uri
to indicate 5 threads.

 to SEDA, e.g. from("seda:stageName?concurrentConsumers=5").process(...),


> can anyone tell me how to do the same thing using xml?
> I have a xml seda route definition.
> <camel:from uri="seda:asyncAuthenticate" />
> <camel:to uri="bean:authenticateBean?method=performIndempotentOperations" />
>
> Thanks a lot.
> Billy
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Add-thread-pool-configuration-for-SEDA-using-xml-tp5716324.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