【问题标题】:Spring cloud Camden.SR1 hystrix.stream hangsSpring cloud Camden.SR1 hystrix.stream 挂起
【发布时间】:2017-03-09 06:10:37
【问题描述】:

我正在尝试在 Spring Cloud 服务中启用 hystrix 流,在 Spring Boot 应用程序中使用 Camden.SR1。 我通过编译时依赖来启用 hystrix:

compile 'org.springframework.cloud:spring-cloud-starter-hystrix'

并在应用程序配置中添加@EnableHystrix。

/mappings 执行器显示 /hystrix.stream 端点可用,但是当我对其执行 GET 时,请求会无限期挂起。 我使用 Brixton.SR6(因此使用 Spring Boot 1.3)尝试了相同的操作,并且 hystrix.stream 端点按预期工作。 是我做错了什么还是回归?

【问题讨论】:

  • 你练习过断路器吗?
  • start.spring.io 的一个简单应用程序向我展示了它正在运行。
  • 这是具有上述更改的 eureka 示例的一个分支:github.com/florind/eureka-aws Hangs for me...
  • 您所做的只是添加@EnableHystrix 任何地方都没有可锻炼的电路,因此溪流中没有任何东西。
  • 顺便说一句,将样本恢复为 Brixton 会使端点响应重复的“ping”,这是我所期望的行为。

标签: spring-boot spring-cloud hystrix


【解决方案1】:

此问题似乎与此处描述的 Hystrix 问题有关:https://github.com/Netflix/Hystrix/issues/1117。这里详述的解决方法解决了它https://github.com/Netflix/Hystrix/issues/1117#issuecomment-192222569

/hystrix.stream 在执行器端点中可用(添加 spring-boot-starter-hateoas 并浏览到 /actuator)。无论此服务中是否有任何启用 hystrix 的功能,这个通告的端点都不应挂起。

【讨论】:

    猜你喜欢
    • 2016-07-28
    • 2017-03-19
    • 2018-07-04
    • 2016-08-06
    • 1970-01-01
    • 1970-01-01
    • 2021-10-05
    • 2019-02-07
    • 2016-06-13
    相关资源
    最近更新 更多