I have a problem in catching the exceptions in my spring integration application.
Flow of operations in my application.
- Http:inbound gateway which receives the request (error-channel defined to my custom error channel)
- Service Activator for basic validations (Exceptions which are thrown from here are handled by error-channel defined on the GW)
- splitter
- Aggregator
Exceptions on my splitter or Aggregator are not handled by my error channel. why?
Steps taken:
I added a chain and included a header enricher and specified an error channel just before the splitter.
After this, any exception on my splitter is handled by my error channel mentioned in the header enricher.
<chain input-channel="invitations">
<header-enricher>
<error-channel ref="failed-invitations" />
</header-enricher>
<int:splitter ref="payloadSplitter" />
</chain>
- But the same doesnt work when do the same on my Aggregator. why?
- Whenever there is an exception in my code, it retries and gets executed more than one time. why?
I have a "errorChannel" defined which logs the exceptions. it doesnt work.
error-channel
to the inbound gateway. We need to see much more of your configuration - for example, you don't have anoutput-channel
on that chain. – Gary Russell