Spring集成示例:: Aggregator
问题描述:
我正在调查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_NUMBER
和IntegrationMessageHeaderAccessor.SEQUENCE_SIZE
HeaderAttributeCorrelationStrategy
为IntegrationMessageHeaderAccessor.CORRELATION_ID
头和SequenceSizeReleaseStrategy
-
答
当你不指定correlation-strategy
和release-strategy
,默认使用。
这正是<splitter>
产生的默认applySequence
。
所有的信息都在Reference Manual。