[
https://issues.apache.org/jira/browse/CAMEL-16802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17386669#comment-17386669
]
Claus Ibsen commented on CAMEL-16802:
-------------------------------------
Ah yeah so its because the splitter breaks down the 3 tasks into a reactive
task that gets executed in parallel (you turned on parallel) but they can be
executed in "random" order, and then each task then submit again a task for the
when its done to aggregate the result, but those tasks are therefore submitted
in random order, and hence why you get 231 etc.
So we have to move the submit ordering to an earlier phase or something
> Split / Aggregate with parallelprocessing aggregates in random order
> --------------------------------------------------------------------
>
> Key: CAMEL-16802
> URL: https://issues.apache.org/jira/browse/CAMEL-16802
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 3.11.0
> Reporter: Sergio Penkale
> Priority: Major
> Fix For: 3.12.0
>
>
> Does the Split/Aggregate EIP guarantee that messages will be aggregated in
> the original order?
> {code:java}
> public class CamelTest extends CamelTestSupport {
> @Override
> protected RoutesBuilder createRouteBuilder() {
> return new RouteBuilder() {
> public void configure() {
> from("direct:start")
> .split(body().tokenize(","), new
> StringAggregationStrategy())
> .parallelProcessing()
> .to("mock:foo")
> .end()
> .to("mock:result");
> }
> };
> }
> @Test
> public void testSplitter() throws Exception {
> getMockEndpoint("mock:result").expectedBodiesReceived("123");
> template.sendBody("direct:start", "1,2,3");
> assertMockEndpointsSatisfied();
> }
> }
> {code}
> With the above I get:
> {code:java}
> [ERROR] Failures:
> [ERROR] CamelTest.testSplitter mock://result Body of message: 0. Expected:
> <123> but was: <231>
> {code}
> The actual order varies randomly from run to run.
>
> In my real route I'm only able to reproduce this during the very first
> request after Camel has started.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)