我正在研究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类未指定任何关联/发布策略。如何聚合/组发布项目?
答案 0 :(得分:3)
如果您未指定correlation-strategy
和release-strategy
,则使用默认值HeaderAttributeCorrelationStrategy
代表IntegrationMessageHeaderAccessor.CORRELATION_ID
代码,SequenceSizeReleaseStrategy
代表IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER
1}}和IntegrationMessageHeaderAccessor.SEQUENCE_SIZE
。
这正是<splitter>
生成的默认applySequence
。
所有信息都完全在Reference Manual。