I'm using spring integration aggregator and MessageGroupStoreReaper but somehow the errors are not reaching global 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>
If there is any exception post "processInputChannel" ( e.g partial result on expiry) then exception is not reaching global "errorChannel".
Even I tried replacing task-scheduled job to inbound channel adapter( as suggested by @Gary) with poller but still it didn't work :
<int:inbound-channel-adapter channel="reaperChannel" ref="MyMsgsAggregator" method="triggerReaper">
<int:poller error-channel="**errorChannel**" fixed-rate="5000">
</int:poller>
</int:inbound-channel-adapter>
Pls suggest
Thanks
Your problem is here:
send-partial-result-on-expiry="true". This option is indeed mutually exclusive with thediscard-channel:So, that's not a surprise that your messages after reaping go to the
processInputChannel, not anerrorChannel.Also, the
discardChannelis not about errors. The exception is not thrown in case of discarding when we reap and anErrorMessageis not sent from there. Everything single message from the reaped group is sent as regular one into that configureddiscardChannel.