我是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拆分器、收件人列表路由器和聚合器。考虑到模式应该有机制来处理这种常见的情况。
你能给我指路吗
即:
<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" />或
<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" />发布于 2019-03-08 22:14:29
是的;聚合器默认情况下是一个“被动”组件-所有操作都是在消息到达时执行的。
要使陈旧的组超时,您可以使用收割器,或者对于较新的版本,可以使用group-timeout。
https://stackoverflow.com/questions/55058168
复制相似问题