Как работает маршрутизация сообщений об ошибках весенней интеграции? - PullRequest
0 голосов
/ 11 февраля 2020

Я настроил мое приложение для весенней интеграции на обработку таких ошибок:

<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>

Однако, когда я сталкиваюсь со следующим исключением, оно не направляет сообщение на канал formatErrorMessageChannel:

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>".

Почему?

1 Ответ

0 голосов
/ 11 февраля 2020

Вы должны быть уверены, что отправляете сообщение на этот error-manager. Простое создание исключения не заставляет все работать против вашего канала ошибок.

См. Документацию для получения дополнительной информации: https://docs.spring.io/spring-integration/docs/5.2.3.RELEASE/reference/html/error-handling.html#error -обработка

...