You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sebastian Gomez <sa...@gmail.com> on 2010/01/12 15:23:50 UTC
[Camel 2.1] Specify ThreadPoolExecutor in Split
Hi everyone,
I've upgraded from Camel 1.6 to Camel 2.1 and everything goes OK (after some
minor changes) except for one thing: on Camel 1.6 I had a splitter declared
with a ThreadPoolExecutor to limit the parallel processing to a number of
threads. On Camel 2.1, the splitter method has been changed to split() and I
don't have the option of specifying a ThreadPoolExecutor. I've tried using
threads(10) after the parallelProcessing, but it doesn't seem to work.
I guess if it has been removed from Camel 1.6 it must be because there
exists a better way to do this in Camel 2.1. Would someone be kind enough to
point it out to me?
Thanks in advance.
Sebastian Gomez.
Re: [Camel 2.1] Specify ThreadPoolExecutor in Split
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 12, 2010 at 3:23 PM, Sebastian Gomez <sa...@gmail.com> wrote:
> Hi everyone,
>
> I've upgraded from Camel 1.6 to Camel 2.1 and everything goes OK (after some
> minor changes) except for one thing: on Camel 1.6 I had a splitter declared
> with a ThreadPoolExecutor to limit the parallel processing to a number of
> threads. On Camel 2.1, the splitter method has been changed to split() and I
> don't have the option of specifying a ThreadPoolExecutor. I've tried using
> threads(10) after the parallelProcessing, but it doesn't seem to work.
>
> I guess if it has been removed from Camel 1.6 it must be because there
> exists a better way to do this in Camel 2.1. Would someone be kind enough to
> point it out to me?
>
> Thanks in advance.
>
> Sebastian Gomez.
>
Hi
We got this answered on the chat, but for people listening.
There is a .executorService builder method on the split to be used for
setting custom thread pool
For example from an unit test:
from("direct:parallel-custom-pool")
.split(body().tokenize(",")).parallelProcessing()
.executorService(customThreadPoolExecutor).to("mock:result");
--
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