Spring集成样本::聚合器

Cis*_*ava 2 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);
    }

}
Run Code Online (Sandbox Code Playgroud)

Waiter类未指定任何关联/释放策略。项目如何汇总/分组发布?

Art*_*lan 5

当您不指定correlation-strategyand时release-strategy,默认使用- HeaderAttributeCorrelationStrategy用于IntegrationMessageHeaderAccessor.CORRELATION_ID标题,并SequenceSizeReleaseStrategy基于IntegrationMessageHeaderAccessor.SEQUENCE_NUMBERand IntegrationMessageHeaderAccessor.SEQUENCE_SIZE

这正是<splitter>使用default产生的结果applySequence

所有信息均在《参考手册》中