2017-06-29 65 views
1

我正在调查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.xmlSpring集成示例:: Aggregator

<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); 
    } 

} 

服务员类没有指定任何关系/发布策略。这些项目是如何汇总/发布的?根据该IntegrationMessageHeaderAccessor.SEQUENCE_NUMBERIntegrationMessageHeaderAccessor.SEQUENCE_SIZEHeaderAttributeCorrelationStrategyIntegrationMessageHeaderAccessor.CORRELATION_ID头和SequenceSizeReleaseStrategy -

回答

2

当你不指定correlation-strategyrelease-strategy,默认使用。

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

所有的信息都在Reference Manual