Spring集成-聚合器中过期的消息组重新过期3次

Spring集成-聚合器中过期的消息组重新过期3次,spring,spring-integration,Spring,Spring Integration,我们有一个带有丢弃通道的聚合器,用于统计丢弃的消息(在达到具体数字时触发操作) 但是查看日志,我发现每个消息组的消息组都会过期3次,我不明白为什么 我的预期行为是,当消息过期时,它将从聚合器中删除,并且不会在路由中再次引入 这是我的聚合器: <int:aggregator id="aggregatorByBatchAndSku" input-channel="productAggregatorChannel" output-channel="productAggregatedChannel

我们有一个带有丢弃通道的聚合器,用于统计丢弃的消息(在达到具体数字时触发操作)

但是查看日志,我发现每个消息组的消息组都会过期3次,我不明白为什么

我的预期行为是,当消息过期时,它将从聚合器中删除,并且不会在路由中再次引入

这是我的聚合器:

<int:aggregator id="aggregatorByBatchAndSku"
input-channel="productAggregatorChannel"
output-channel="productAggregatedChannel"
expire-groups-upon-completion="true"
release-strategy="mainAggregatorReleaseStrategy"
release-strategy-method="canRelease"
correlation-strategy-expression="headers[${rip.headers.batchno.name}]+headers[${rip.headers.skuid.name}]"
discard-channel="aggregatorDiscardChannel"
send-partial-result-on-expiry="false"
group-timeout="${rip.config.aggregator.group_timeout}"
expire-groups-upon-timeout="true"
/>

我找到了根本原因

在聚合器使用discard通道之后,我让一个服务激活器对消息进行计数,然后输出到另一个通道,路由在那里结束

激活调试模式时,我看到MessageGroup被重新调度,因为没有消费者连接到该终端通道


2017-04-20 12:12:08.987 DEBUG 15272 --- [sk-scheduler-10] .s.i.a.AbstractCorrelatingMessageHandler : The MessageGroup [ 666110005888011] is rescheduled by the reason: Dispatcher has no subscribers for channel 'application:test:-1.fakeChannel'.; nested exception is org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers
2017-04-20 12:12:08.987 DEBUG 15272 --- [sk-scheduler-10] .s.i.a.AbstractCorrelatingMessageHandler : Schedule MessageGroup [ SimpleMessageGroup{groupId=666110005888011, messages=[GenericMessage [payload=.....

因此,解决方案是将ServiceActivator作为终止元素,不返回任何值。

Hm。我不喜欢这种情况。至少必须在“警告”下记录。请就此事提出JIRA,并修改该行为