【发布时间】:2021-06-03 19:09:59
【问题描述】:
我正在使用 spring 集成聚合器和 MessageGroupStoreReaper,但不知何故错误没有到达全局 errorChannel。
<int:aggregator id="agg"
ref="MyMsgsAggregator"
input-channel="myAggInputChannel"
output-channel="processInputChannel"
discard-channel="errorChannel"
method="aggMessages"
message-store="messageGroupStore"
send-partial-result-on-expiry="true"
expire-groups-upon-completion="true" />
<bean id="messageGroupStore" class="org.springframework.integration.store.SimpleMessageStore" />
<task:scheduled-tasks>
<task:scheduled ref="multipartAggregatorReaper" method="run" fixed-rate="5000" />
</task:scheduled-tasks>
如果在“processInputChannel”后有任何异常(例如到期时的部分结果),则异常未到达全局“errorChannel”。
即使我尝试用轮询器将任务计划的作业替换为入站通道适配器(如 @Gary 所建议的那样),但它仍然不起作用:
<int:inbound-channel-adapter channel="reaperChannel" ref="MyMsgsAggregator" method="triggerReaper">
<int:poller error-channel="**errorChannel**" fixed-rate="5000">
</int:poller>
入站通道适配器>
请推荐
谢谢
【问题讨论】:
-
第一步是打开
o.s.integration的调试日志并跟踪流经通道的消息。 -
请参阅我的答案以获取一些发现和解释。
标签: spring spring-integration integration aggregator