简体   繁体   English

在Zuul中禁用断路器(Hystrix)以获取特定的弹簧轮廓?

[英]Disable Circuit Breaker (Hystrix) in Zuul for specific spring profiles?

We have several negative test cases that we run as part of our integration suite. 作为集成套件的一部分,我们有几个负面的测试案例。 These cases have a nasty habit of apparently tripping the hystrix circuit breaker and disabling servers that are delivering expected bad responses. 这些案例有一种令人讨厌的习惯,即显然绊倒了hystrix断路器并禁用了提供预期不良响应的服务器。

I'd like to configure the spring profile in Zuul to disable the circuit breaker in our test environment. 我想在Zuul配置弹簧轮廓以在我们的测试环境中禁用断路器。

I had attempted to use 我试图使用

hystrix.command.default.circuitBreaker.enabled: false

It looks like it may work if I define this for each possible hystrix command key (which I haven't dug into how to find yet). 如果我为每个可能的hystrix命令键定义了此命令,则它似乎可以工作(我还没有研究如何找到它)。 Assuming this would be the correct configuration, is there a way to wildcard it, or otherwise just turn off hystrix for certain spring profiles? 假设这是正确的配置,是否有通配符的方法,或者只是针对某些弹簧轮廓关闭了hystrix?

I'm not familiar with Zuul but you can use Hystrix ConfigurationManager for tuning your parameters. 我不熟悉Zuul但您可以使用Hystrix ConfigurationManager来调整参数。

ConfigurationManager.getConfigInstance()
                    .setProperty("hystrix.command.default.circuitBreaker.enabled", false);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Hystrix 断路器在 Spring Micro 服务实现中触发一个事件 - Hystrix circuit breaker trigger an Event in Spring Micro service implementation Spring 云网关断路器:默认和特定 - Spring Cloud Gateway Circuit Breaker: Default and Specific 为什么要为微服务使用 hystrix 或任何其他断路器? - why hystrix or any other circuit breaker for a microservice? 带断路器的弹簧重试 - Spring-Retry with Circuit breaker 如何为带有断路器的弹簧集成服务激活器设计后备? - how to design a fallback for a spring integration service activator with circuit breaker? 使用 Spring Boot 的 Resilience4J 断路器的 Bean 配置 - Bean Configuration for Circuit Breaker of Resilience4J Using Spring Boot Spring 集成流程:每个端点或流量级别的断路器 - Spring Integration Flow : Circuit breaker for each endpoints or at flow level 如何将 Spring 断路器与缓存管理器一起使用? - How do you use Spring Circuit Breaker with Cache Manager? Spring Cloud:如何在Zuul网关中为Hystrix定义默认回退? - Spring Cloud: How to define default fallback for Hystrix in Zuul gateway? 如何添加断路器 <int:gateway> 在春季整合 - How add a circuit breaker for <int:gateway> in spring integration
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM