Spring Integration Sample :: Aggregator

时间:2017-06-29 16:41:11

标签: spring-integration

我正在研究spring-projects / spring-integration-samples中的聚合器示例 https://github.com/spring-projects/spring-integration-samples/blob/master/applications/cafe/cafe-si/src/main/resources/META-INF/spring/integration/cafeDemo-xml.xml

<int:aggregator input-channel="preparedDrinks"  method="prepareDelivery" output-channel="deliveries">
    <beans:bean class="org.springframework.integration.samples.cafe.xml.Waiter"/>
</int:aggregator>


public class Waiter {

    public Delivery prepareDelivery(List<Drink> drinks) {
        return new Delivery(drinks);
    }

}

Waiter类未指定任何关联/发布策略。如何聚合/组发布项目?

1 个答案:

答案 0 :(得分:3)

如果您未指定correlation-strategyrelease-strategy,则使用默认值HeaderAttributeCorrelationStrategy代表IntegrationMessageHeaderAccessor.CORRELATION_ID代码,SequenceSizeReleaseStrategy代表IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER 1}}和IntegrationMessageHeaderAccessor.SEQUENCE_SIZE

这正是<splitter>生成的默认applySequence

所有信息都完全在Reference Manual