【问题标题】:Apache Camel and Hystrix Command NameApache Camel 和 Hystrix 命令名称
【发布时间】:2017-02-20 06:23:27
【问题描述】:

我很高兴在最新的 Apache Camel 版本 2.18.0 中通过 DSL 看到 hystrix 支持。我的问题是 - 现在如何命名 hystrix 命令?

假设我写 -

from("direct:start").hystrix().to("log:out")

Hystrix 仪表板将注册“hystrix1”命令并为其显示统计信息,这就是我要更改的点。

Apache Camel 的文档说 - “CommandKey - 用于识别 hystrix 命令。此选项无法配置,但被锁定为节点 ID 以使命令唯一。”。在他们的代码中,我看到他们使用路由的命名策略,所以它可能有点可定制,我只是不知道如何。

提前致谢!

【问题讨论】:

    标签: apache-camel hystrix


    【解决方案1】:

    我们让它使用节点 ID 作为命令名称。所以你可以试试 使用id设置节点id:

    hystrix().id("myNameHere")
       ...
    

    【讨论】:

      猜你喜欢
      • 2017-02-22
      • 2017-04-06
      • 1970-01-01
      • 2017-08-16
      • 2020-01-30
      • 2018-07-15
      • 2018-09-12
      • 2018-08-01
      • 2019-08-27
      相关资源
      最近更新 更多