Reputation: 1283
I have configured my spring integration app to manage errors like this :
<exception-type-router resolution-required="true" default-output-channel="errorChannelStop" input-channel="error-manager">
<mapping exception-type="org.springframework.xml.validation.XmlValidationException" channel="formatErrorMessageChannel" />
</exception-type-router>
However, when I encounter the following exception, it doesn't route the message to the formatErrorMessageChannel
channel :
org.springframework.xml.validation.XmlValidationException: Could not validate source: The element type "messageType" must be terminated by the matching end-tag "</messageType>".;
nested exception is org.xml.sax.SAXParseException; line number: 9; columnNumber: 24; The element type "message Type" must be terminated by the matching end-tag "</messageType>".
...
Caused by: org.xml.sax.SAXParseException: The element type "message Type" must be terminated by the matching end-tag "</messageType>".
Why ?
Upvotes: 0
Views: 92
Reputation: 121262
You need to be sure that you send a message into that error-manager
. Just throwing an exception doesn't make everything working against your error channel.
See docs for more info: https://docs.spring.io/spring-integration/docs/5.2.3.RELEASE/reference/html/error-handling.html#error-handling
Upvotes: 1