首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >了解Spring Integration中Splitter和Aggregator或recipient-list-router和Aggregator之间出现异常时如何清理存储

了解Spring Integration中Splitter和Aggregator或recipient-list-router和Aggregator之间出现异常时如何清理存储
EN

Stack Overflow用户
提问于 2019-03-08 14:54:02
回答 1查看 35关注 0票数 0

我是spring集成的新手,我们已经创建了一个SI流,其中我们有Splitter和Aggregator,还有recipient-list-router和Aggregator。今天,在检查一段代码时,我搞不清如果我们在两个流之间出现异常,聚合器将如何清理其存储。我担心在流程和在系统中创建陈旧状态对象之间出现异常的情况。我已经检查了spring集成文档,但没有成功(https://docs.spring.io/spring-integration/docs/2.0.0.RC1/reference/html/aggregator.html)。我只能看到一个“在聚合器中管理状态: MessageGroupStore”的主题,但这是关于“应用程序快照”的。

此外,我也做了同样的谷歌,我找到了一个线程https://dzone.com/articles/spring-integration-robust,但不能跟随太多。当然,如果我能找到一些解决方案,我会回来的。

我正在使用OOB拆分器、收件人列表路由器和聚合器。考虑到模式应该有机制来处理这种常见的情况。

你能给我指路吗

即:

代码语言:javascript
复制
<int:recipient-list-router input-channel="inputChannel" 
        default-output-channel="nullChannel">
        <int:recipient channel="aInputChannel" />
         <int:recipient channel="bInputChannel" />
</int:recipient-list-router>

<int:service-activator ref="aHandler"
        input-channel="aInputChannel" output-channel="aggregatorOutputChannel" />

<!-- we have exception in the bHandler -->
<int:service-activator ref="bHandler"
        input-channel="bInputChannel" output-channel="aggregatorOutputChannel" />


<int:aggregator input-channel="aggregatorOutputChannel"
        output-channel="outputChannel" />

代码语言:javascript
复制
<int-file:splitter id="splitile"
        charset="UTF-8" apply-sequence="true" iterator="false"
        input-channel="inputChannel"
        output-channel="bTransformerChannel" />
<!-- consider we have exception at 4th chunk -->
<int:service-activator ref="transform"
        input-channel="bTransformerChannel" output-channel="aggregatorOutputChannel" />
<int:aggregator input-channel="aggregatorOutputChannel"
            output-channel="outputChannel" />
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-08 22:14:29

是的;聚合器默认情况下是一个“被动”组件-所有操作都是在消息到达时执行的。

要使陈旧的组超时,您可以使用收割器,或者对于较新的版本,可以使用group-timeout

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55058168

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档