I am looking for an good error handling example for spring integration. All I really want to do is a call a method, when this flow fails. The idea is the called method will send out an error email.
@Bean
public IntegrationFlow sampleHasErrorFlow() {
return IntegrationFlows.from(fileReadingMessageSource())
.channel(filesInChannel())
.publishSubscribeChannel(s -> s
.subscribe(f -> f
.handle("sampleBean", "methodThatThrowsException")
.channel(filesProcessedChannel())))
.get();
}
I just want to “catch” the exception thrown in methodThatThrowsException(). Can someone produce a quick sample?