gpt4 book ai didi

spring-integration - Spring Integration 示例::聚合器

转载 作者:行者123 更新时间:2023-12-02 00:44:14 30 4
gpt4 key购买 nike

我正在查看 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 类没有指定任何关联/释放策略。这些项目是如何聚合/分组发布的?

最佳答案

当您不指定 correlation-strategy 时和 release-strategy , 默认使用 - HeaderAttributeCorrelationStrategy对于 IntegrationMessageHeaderAccessor.CORRELATION_ID header 和 SequenceSizeReleaseStrategy基于 IntegrationMessageHeaderAccessor.SEQUENCE_NUMBERIntegrationMessageHeaderAccessor.SEQUENCE_SIZE .

这正是<splitter>使用默认值 applySequence 生成.

所有信息都在 Reference Manual 中.

关于spring-integration - Spring Integration 示例::聚合器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44830757/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com