【问题标题】:Exception handling with http gateways in spring integration在 Spring 集成中使用 http 网关进行异常处理
【发布时间】:2015-08-08 09:27:40
【问题描述】:

我的项目中有一个模块,它使用 spring 集成 http inbound gatweways 公开 restful web 服务。我想为其添加一些错误处理,以便能够将底层异常转换为具有适当结果代码的错误 json 响应。在我的其他 spring mvc 模块中,我使用@controlleradvice 和@exceptionhandler 也达到了同样的效果。有没有办法在 spring 集成 http 网关上实现类似的行为。谢谢

【问题讨论】:

    标签: spring http spring-mvc exception-handling spring-integration


    【解决方案1】:

    向网关添加error-channel 并处理异常/返回错误流的一些结果。 ErrorMessage 有效负载是 MessagingException,它有两个属性:failedMessagecause

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多