简体   繁体   English

实现断路器模式,spring hystrix 和 retryable 哪个更好用

[英]to implement circuit breaker pattern, spring hystrix and retryable which one is better to use

I was looking for the difference between spring hystrix and retryable in spring boot microservices as both are used to implement circuit breaker pattern.Thanks.我正在寻找 spring hystrix 和 spring 引导微服务中的可重试之间的区别,因为两者都用于实现断路器模式。谢谢。

AFAIK, a circuit breaker is a component does not retry an operation that it's going to fail anyway. AFAIK,断路器是一个组件,它不会重试无论如何都会失败的操作。

Spring boot's @Retryable was not designed to work as a circuit breaker, but as an exponential-backoff retry mechanism. Spring 引导的@Retryable并非设计为用作断路器,而是用作指数退避重试机制。

Hystrix is a circuit breaker library, but unfortunately it's not longer maintained. Hystrix 是一个断路器库,但不幸的是它不再维护。 You can use Resilience4J .您可以使用Resilience4J It's inspired from Hystrix, but much better.它的灵感来自 Hystrix,但要好得多。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM