如何记录弹性4J骆驼路线中后备的原因

发布于 2025-02-05 07:28:03 字数 53 浏览 2 评论 0原文

在弹性4J配置中,我有用于断路器,舱壁和线程超时的参数。后备后,我将无法找出导致后备的原因。

in resilience4j configuration I have params for circuit breaker, bulkhead and thread timeout together. Once the fallback happens, I am unable to find out what caused the fallback.I am implementing the resilience4j configuration in camel route.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独自←快乐 2025-02-12 07:28:04

您无法混合fallback和异常,请使用dotry()和throwExceptionwhenhalfopenoropenstate(true)configuraton:

.doTry()
  .circuitBreaker()
    .resilience4jConfiguration()
        .throwExceptionWhenHalfOpenOrOpenState(true)
     .end()
     .to("http://fooservice.com/faulty")
    .end()
  .endDoTry()
  .doCatch(Exception.class)
     .log("${exception.message}")
  .end

You can't mix onFallback and Exception, use doTry() and throwExceptionWhenHalfOpenOrOpenState(true) configuraton :

.doTry()
  .circuitBreaker()
    .resilience4jConfiguration()
        .throwExceptionWhenHalfOpenOrOpenState(true)
     .end()
     .to("http://fooservice.com/faulty")
    .end()
  .endDoTry()
  .doCatch(Exception.class)
     .log("${exception.message}")
  .end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文