Example usage for org.springframework.integration.aggregator ExpressionEvaluatingCorrelationStrategy ExpressionEvaluatingCorrelationStrategy

List of usage examples for org.springframework.integration.aggregator ExpressionEvaluatingCorrelationStrategy ExpressionEvaluatingCorrelationStrategy

Introduction

In this page you can find the example usage for org.springframework.integration.aggregator ExpressionEvaluatingCorrelationStrategy ExpressionEvaluatingCorrelationStrategy.

Prototype

public ExpressionEvaluatingCorrelationStrategy(Expression expression) 

Source Link

Usage

From source file:org.springframework.cloud.stream.app.hdfs.dataset.sink.HdfsDatasetSinkConfiguration.java

@Bean
@Primary//w  w w  . j  a v  a  2  s  . c  o m
@ServiceActivator(inputChannel = Sink.INPUT)
FactoryBean<MessageHandler> aggregatorFactoryBean(MessageChannel toSink, MessageGroupStore messageGroupStore) {
    AggregatorFactoryBean aggregatorFactoryBean = new AggregatorFactoryBean();
    aggregatorFactoryBean
            .setCorrelationStrategy(new ExpressionEvaluatingCorrelationStrategy("payload.getClass().name"));
    aggregatorFactoryBean.setReleaseStrategy(new MessageCountReleaseStrategy(properties.getBatchSize()));
    aggregatorFactoryBean.setMessageStore(messageGroupStore);
    aggregatorFactoryBean.setProcessorBean(new DefaultAggregatingMessageGroupProcessor());
    aggregatorFactoryBean.setExpireGroupsUponCompletion(true);
    aggregatorFactoryBean.setSendPartialResultOnExpiry(true);
    aggregatorFactoryBean.setOutputChannel(toSink);
    return aggregatorFactoryBean;
}