title: Apache Camel join ALL exchanges in nested split
body: <p>I'm fairly new to Apache Camel and have a couple questions. I want my route to do the following:</p>
  
  <ul>
  <li>load a list of lists in <code>LoadSomeThingsProcessor</code></li>
  <li>split twice so I can handle each item in the inner list</li>
  <li>filter out some things I don't need</li>
  <li>join all remaining exchanges from the inner split</li>
  <li>then eventually join again (back to one exchange)</li>
  </ul>
  
  <p>My route that looks something like the following:</p>
  
  <pre><code>from("direct:myRoute")
      .process(new LoadSomeThingsProcessor())
      .split(body())
      .streaming()
      .process(new SomeProcessor())
      .split(body())
      .streaming()
      .filter(new SomeFilter())
      .aggregate(header("myHeader", new MyAggregationStrategy())
      .completionPredicate(new MyCompletionPredicate())
      // more processors
      // aggregate again (should just be one exchange after this point
      // more processors
      .to("direct:someOtherRoute");
  </code></pre>
  
  <p><code>MyCompletionPredicate</code>'s <code>matches</code> method is just:</p>
  
  <pre><code>return exchange.getIn().getProperty("CamelSplitComplete", Boolean.class);
  </code></pre>
  
  <p>I want to ensure that ALL exchanges in each split are aggregated together before I continue.</p>
  
  <p>My questions are:
  - The <code>CamelSplitComplete</code> header is somehow never true. What could cause this?
  - Is trying to aggregate inside a nested split going to cause any issues?
  - What happens if the last exchange (the one that is supposed to have <code>CamelSplitComplete = true</code> is filtered out? How can I know that I have aggregated all my exchanges together?
  - Is this even the right way to approach this problem? If no, what else should I consider?</p>
  
  <p>FYI my aggregation strategy just takes the bodies of the new exchange and adds them to the body of the old exchange.</p>
  
  <p>Many thanks in advance.</p>