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:
- input
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
(T0,P1),(T1,P1),(T2,P2),(T3,P3),(T4,P4)...
- aggregation
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:
[(T0,P1),(T1,P1),(T2,P2)],
[(T1,P1),(T2,P2),(T3,P3)],
[(T2,P2),(T3,P3),(T4,P4)],
....
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 without writing one.
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.S.
after reading the source code of camel, seems camel can not support our requirement. Just try my luck with spring. Finger crossed camel question