Spring cloud Camden.SR1 hystrix.stream 挂起

Posted

技术标签:

【中文标题】Spring cloud Camden.SR1 hystrix.stream 挂起【英文标题】:Spring cloud Camden.SR1 hystrix.stream hangs 【发布时间】: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”,这是我所期望的行为。 【参考方案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 的功能,这个通告的端点都不应挂起。

【讨论】:

以上是关于Spring cloud Camden.SR1 hystrix.stream 挂起的主要内容,如果未能解决你的问题,请参考以下文章

spring cloud

spring cloud

spring Cloud对应springBoot版本推荐

spring Cloud对应springBoot版本推荐

Spring Cloud(Dalston.SR5)--Hystrix 断路器

Spring Cloud构建微服务架构服务消费者