Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This strategy defines the key for the grouping of the messages.
The default grouping is based on the CORRELATION_ID message. Thus, all the messages
with the same CORRELATION_ID will be
stored in a separate bucket for aggregation.
The framework provides a HeaderAttributeCorrelationStrategy out of the
box. You can also implement your own strategy, either by implementing
the interface or
creating your own POJO. In the former case, you have to implement the
CorrelationStrategygetCorrelationKey() method that will
return the key as shown below:
public class MyCorrelationStrategy implements CorrelationStrategy {
public Object getCorrelationKey(Message<?> message) {
// implement your own correlation key here
// return ..
}
}