Yes, you can write a custom error handler; for example...
Code:
public class ErrorHandler {
public void myHandler(Exception e) {
//handle
e.printStackTrace();
}
}
In your config...
Code:
<integration:service-activator ref="eh" input-channel="errorChannel"/>
<bean id="eh" class="gpr.ErrorHandler"/>
Result:
Code:
org.springframework.integration.MessageHandlingException: failed to write Message payload to file
at
...
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.FileNotFoundException: /tmp/out/zzzx.writing (Permission denied)
...
... 40 more
Error messages, by default, are sent to a well-known channel called 'errorChannel' which you can consume messages from.