Search in sources :

Example 1 with MessageGroupProcessor

use of org.springframework.integration.aggregator.MessageGroupProcessor in project spring-integration by spring-projects.

the class AggregatorFactoryBean method createHandler.

@Override
protected AggregatingMessageHandler createHandler() {
    MessageGroupProcessor outputProcessor;
    if (this.processorBean instanceof MessageGroupProcessor) {
        outputProcessor = (MessageGroupProcessor) this.processorBean;
    } else {
        if (!StringUtils.hasText(this.methodName)) {
            outputProcessor = new MethodInvokingMessageGroupProcessor(this.processorBean);
        } else {
            outputProcessor = new MethodInvokingMessageGroupProcessor(this.processorBean, this.methodName);
        }
    }
    AggregatingMessageHandler aggregator = new AggregatingMessageHandler(outputProcessor);
    if (this.expireGroupsUponCompletion != null) {
        aggregator.setExpireGroupsUponCompletion(this.expireGroupsUponCompletion);
    }
    if (this.sendTimeout != null) {
        aggregator.setSendTimeout(this.sendTimeout);
    }
    if (this.outputChannelName != null) {
        aggregator.setOutputChannelName(this.outputChannelName);
    }
    if (this.metrics != null) {
        aggregator.configureMetrics(this.metrics);
    }
    if (this.statsEnabled != null) {
        aggregator.setStatsEnabled(this.statsEnabled);
    }
    if (this.countsEnabled != null) {
        aggregator.setCountsEnabled(this.countsEnabled);
    }
    if (this.lockRegistry != null) {
        aggregator.setLockRegistry(this.lockRegistry);
    }
    if (this.messageStore != null) {
        aggregator.setMessageStore(this.messageStore);
    }
    if (this.correlationStrategy != null) {
        aggregator.setCorrelationStrategy(this.correlationStrategy);
    }
    if (this.releaseStrategy != null) {
        aggregator.setReleaseStrategy(this.releaseStrategy);
    }
    if (this.groupTimeoutExpression != null) {
        aggregator.setGroupTimeoutExpression(this.groupTimeoutExpression);
    }
    if (this.forceReleaseAdviceChain != null) {
        aggregator.setForceReleaseAdviceChain(this.forceReleaseAdviceChain);
    }
    if (this.taskScheduler != null) {
        aggregator.setTaskScheduler(this.taskScheduler);
    }
    if (this.discardChannel != null) {
        aggregator.setDiscardChannel(this.discardChannel);
    }
    if (this.discardChannelName != null) {
        aggregator.setDiscardChannelName(this.discardChannelName);
    }
    if (this.sendPartialResultOnExpiry != null) {
        aggregator.setSendPartialResultOnExpiry(this.sendPartialResultOnExpiry);
    }
    if (this.minimumTimeoutForEmptyGroups != null) {
        aggregator.setMinimumTimeoutForEmptyGroups(this.minimumTimeoutForEmptyGroups);
    }
    if (this.expireGroupsUponTimeout != null) {
        aggregator.setExpireGroupsUponTimeout(this.expireGroupsUponTimeout);
    }
    return aggregator;
}
Also used : AggregatingMessageHandler(org.springframework.integration.aggregator.AggregatingMessageHandler) MethodInvokingMessageGroupProcessor(org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor) MessageGroupProcessor(org.springframework.integration.aggregator.MessageGroupProcessor) MethodInvokingMessageGroupProcessor(org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor)

Aggregations

AggregatingMessageHandler (org.springframework.integration.aggregator.AggregatingMessageHandler)1 MessageGroupProcessor (org.springframework.integration.aggregator.MessageGroupProcessor)1 MethodInvokingMessageGroupProcessor (org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor)1