Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Aggregators > Correlation Strategy

Correlation Strategy

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 CorrelationStrategy interface or creating your own POJO. In the former case, you have to implement the getCorrelationKey() 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 ..
  }
}

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint