title: Camel AggregationStrategy producing NULL bodied messages
body: <p>I currently have the following Camel route:</p>
  
  <pre><code>&lt;camelContext id="my-camel-context" xmlns="http://camel.apache.org/schema/spring"&gt;
      &lt;propertyPlaceholder id="envProps" location="classpath:myapp.properties" /&gt;
      &lt;route id="my-camel-route"&gt; 
          &lt;from uri="{{start.uri}}"/&gt;
  
          &lt;setHeader headerName="id"&gt;
              &lt;constant&gt;1&lt;/constant&gt;
          &lt;/setHeader&gt;
  
          &lt;to uri="bean:preProcessor?method=process" /&gt;
  
          &lt;aggregate strategyRef="myAggregationStrategy" completionSize="1"&gt;
              &lt;correlationExpression&gt; 
                  &lt;simple&gt;${header.id} == 1&lt;/simple&gt; 
              &lt;/correlationExpression&gt;
              &lt;to uri="bean:postProcessor?method=process" /&gt; 
          &lt;/aggregate&gt; 
  
          &lt;to uri="bean:mailer?method=process" /&gt; 
      &lt;/route&gt; 
  &lt;/camelContext&gt;
  
  &lt;bean id="myAggregationStrategy" class="com.me.myapp.MyAggregationStrategy" /&gt;
  &lt;bean id="postProcessor" class="com.me.myapp.PostProcessor" /&gt;
  &lt;bean id="mailer" class="com.me.myapp.Mailer" /&gt;
  </code></pre>
  
  <p>For now, I'm not really aggregating anything meaningful (<code>completionSize=1</code>), I'm really just testing <code>AggregationStrategy</code> out. Here's my strategy:</p>
  
  <pre><code>public class MyAggregationStrategy implements AggregationStrategy {
      @Override
      public Exchange aggregate(Exchange aggregatingExchange, Exchange incomingExchange) {
          AppPayload payload = null;
  
          if(aggregatingExchange == null)
              payload = new AppPayload(); // This should prevent it from being NULL below in PostProcessor...
          else
              payload = (AppPayload)incomingExchange.getIn().getBody();
  
          payload.setCargo((Order)incomingExchange.getIn().getBody());
  
          if(aggregatingExchange == null) {
              incomingExchange.getIn().setBody(payload);
              return incomingExchange;
          }
          else
              return aggregatingExchange;
      }
  }
  </code></pre>
  
  <p>And also my <code>postProcessor</code> bean:</p>
  
  <pre><code>public class PostProcessor implement Processor {
      @Override
      public void process(Exchange exchange) {
          try {
              System.out.println("In PostProcessor...");
              AppPayload payload = (AppPayload)exchange.getIn().getBody();
              System.out.println("\t...payload acquired...");
  
              if(payload == null)
                  System.out.println("Payload is NULL.");
          } catch(Throwable throwable) {
              System.out.println(ExceptionUtils.getFullStackTrace(throwable));
          }
      }
  }
  </code></pre>
  
  <p>When I run this code, I see log messages from my <code>preProcessor</code> bean that inidcate it is executing correctly. And I also see that <code>MyAggregationStrategy</code> is correctly "aggregating" the message and then letting it pass on to <code>postProcessor</code> after the 1st message arrives (again, because <code>completionSize=1</code>). However, I'm getting the following output in <code>postProcessor</code>:</p>
  
  <pre><code>In PostProcessor...
      ...payload acquired...
  Payload is NULL.
  </code></pre>
  
  <p><strong>Can anyone see why <code>payload</code> would be NULL?</strong> Shouldn't it have been initialized up inside <code>MyAggregationStrategy</code>?!? I'm happy to post more code, but I believe it stems from me using the <code>AggregationStrategy</code> API incorrectly.</p>