Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16802

camel-core - Split / Aggregate with parallelprocessing aggregates in random order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.11.0
    • 3.7.6, 3.11.1, 3.12.0
    • camel-core
    • None
    • Unknown

    Description

      Does the Split/Aggregate EIP guarantee that messages will be aggregated in the original order?

      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();
          }
      }
      

      With the above I get:

      [ERROR] Failures: 
      [ERROR]   CamelTest.testSplitter mock://result Body of message: 0. Expected: <123> but was: <231>
      

      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.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            spenkale Sergio Penkale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: