用于包装节俭客户端的 Hystrix 替代品?

Alternatives to Hystrix for wrapping around a thrift client?

我正在查看 netflix 的 hystrix 以环绕网络调用。

使用 hystrix,您可以为每个需要使用的潜在 RPC 命令定义 HystrixCommand<E> 的子class。

我设置了一个 apache thrift 客户端,其中有很多命令。是否有任何替代 hystrix 的方法可以让我轻松地将它包装在整个客户端周围,而不是必须为每个函数定义一个 HystrixCommand class?

我也在为节俭客户寻找类似 hystrix 的断路器解决方案。将试用 Phantom (https://github.com/flipkart/phantom),它在底层提供了一个带有 hystrix 的节俭代理。

在我正在进行的项目中,我有数百个不同类型的集成,我想要一个通用解决方案,允许我对其中任何一个应用断路器。为此,我使用 org.springframework.aop.framework.ProxyFactory 和自定义 class 包装实现 org.aopalliance.intercept.MethodInterceptorHystrixCommand。不过,任何动态代理实施都应该有效。

Twitter 的 Finagle 是 Netflix 的 Hystrix 的替代品。

Finagle 根据需要为整个客户端创建一个 RPC,当然 Finagle 会讨论 Thrift 和 Redis、MySQL、memcached 等

Finagle 是用 Scala 创建的,但它也可以与 Java(以及所有 JVM 生态系统语言,如 JRuby 和 Clojure)一起使用

当然,您甚至可以使用 JVM 之外的其他语言,因为 Finagle 可以与 Thrift 对话,而 Thrift 可用于许多其他语言和平台,例如 Go、C#,甚至 Objective-C 用于 iPhone 或 iPad 作为客户端而不是缓慢的 Json/HTTP 调用。

这里有更多关于 Finagle 的信息 -> https://twitter.github.io/finagle/guide/ and here an starting project sample with Finagle Maven and Java -> https://github.com/csaltos/hello-finagle-maven

您可能想看看 resilience4j

In Hystrix calls to external systems have to be wrapped in a HystrixCommand. This library, in contrast, provides higher-order functions (decorators) to enhance any functional interface, lambda expression or method reference with a Circuit Breaker, Rate Limiter or Bulkhead.