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 2013/03/14 19:09:36 UTC

Question on Splitter Parallel Processing

Hi Folks,

I have a route using a Splitter with parallel processing enabled. The
exchange contains List<SomeObject> someObjectList and the size of
someObjectList is five.

SomeObject contains a property - *id* If the first two elements of the list
contain the same id, is it possible to process these on the same thread
(i.e. these two elements are sticky to a certain thread) while the other
three elements are processed on separete threads?

Any insights are much appreciated.

Thanks,
Edwin



--
View this message in context: http://camel.465427.n5.nabble.com/Question-on-Splitter-Parallel-Processing-tp5729204.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Question on Splitter Parallel Processing

Posted by Willem jiang <wi...@gmail.com>.
I'm not sure why do you want to implement this kind of feature, may be you can do it by implement a custom ExcutorService and set the ExcutorService to the Splitter.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Friday, March 15, 2013 at 2:09 AM, Edwin wrote:

> Hi Folks,
>  
> I have a route using a Splitter with parallel processing enabled. The
> exchange contains List<SomeObject> someObjectList and the size of
> someObjectList is five.
>  
> SomeObject contains a property - *id* If the first two elements of the list
> contain the same id, is it possible to process these on the same thread
> (i.e. these two elements are sticky to a certain thread) while the other
> three elements are processed on separete threads?
>  
> Any insights are much appreciated.
>  
> Thanks,
> Edwin
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Question-on-Splitter-Parallel-Processing-tp5729204.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Re: Question on Splitter Parallel Processing

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Mar 14, 2013 at 7:09 PM, Edwin <ed...@gmail.com> wrote:
> Hi Folks,
>
> I have a route using a Splitter with parallel processing enabled. The
> exchange contains List<SomeObject> someObjectList and the size of
> someObjectList is five.
>
> SomeObject contains a property - *id* If the first two elements of the list
> contain the same id, is it possible to process these on the same thread
> (i.e. these two elements are sticky to a certain thread) while the other
> three elements are processed on separete threads?
>
> Any insights are much appreciated.
>

I would pre process the message body before hitting the splitter.
eg there you can put together those elements that belong together. eg
in your case 5 elements in the list.
And then put 1+2 together, so the output list has 4 elements.




> Thanks,
> Edwin
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Question-on-Splitter-Parallel-Processing-tp5729204.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen