Camel - Exception handling in 'sub routes'

后端 未结 1 1724
攒了一身酷
攒了一身酷 2021-02-05 11:35

Camel explicitly handles two \'scopes\' of error handling:

  • Global
  • per Route

The issue I\'m having is exceptions thrown in a \'sub route\'.

相关标签:
1条回答
  • 2021-02-05 12:06

    Got the answer from a colleague: The subroute needs to have it's error handling disabled:

    from("direct:sendToWebservice").
        .errorHandler(noErrorHandler())     // disables error handling for this route
        .processRef("massageBeforeSending").
        .to("http://webservice.com").
        .processRef("massageResponse");
    

    This forces Camel to propagate the error to the calling route.

    0 讨论(0)
提交回复
热议问题