title: How to aggrate one message into multiple groups by spring integration Aggregator
body: <p>Hi we are trying to streaming process finance market data to calculate trading signal by leveraging apache camel or spring integration. 
  One of our use case is to aggregate consecutive prices together based on price timestamps as following:</p>
  
  <ul>
  <li><strong>input</strong></li>
  </ul>
  
  <p>the input message comes as (timestamp,price) pairs in time series. Suppose the values coming in as, each pair (TX,PX) is a message while T for time stamp and P for price value</p>
  
  <pre><code>(T0,P1),(T1,P1),(T2,P2),(T3,P3),(T4,P4)... 
  </code></pre>
  
  <ul>
  <li><strong>aggregation</strong></li>
  </ul>
  
  <p>suppose we need to aggregate every 3 consecutive messages together for further calculation, given the input message we need to produce the following groups, each 3 pairs group is an aggregated message:</p>
  
  <pre><code>[(T0,P1),(T1,P1),(T2,P2)],
  [(T1,P1),(T2,P2),(T3,P3)],
  [(T2,P2),(T3,P3),(T4,P4)],
  ....
  </code></pre>
  
  <p>As you can see most of the messages will be aggregate to more than one group. Can someone suggests if there is a way to do this by using current aggregator <strong>without</strong> writing one. </p>
  
  <p>It seems that spring integration aggregate grouping is based on correlation key as well, so the messages will need to map to a group of correlation keys. However, the current api seems only allow us to produce one correlation key, which means each message can only be aggregated to one group. Is there any work around for this.</p>
  
  <p><strong>P.S.</strong> </p>
  
  <p>after reading the source code of camel, seems camel can not support our requirement. Just try my luck with spring. <em>Finger crossed</em> <a href="https://stackoverflow.com/questions/19789585/how-to-aggregate-one-message-into-multiple-group-with-camel-aggregate">camel question</a></p>