Using Spring Cloud Zookeeper with Spring Cloud Components

Feign、Spring Cloud Gateway 和 Spring Cloud LoadBalancer 均可与 Spring Cloud Zookeeper 配合使用。

Spring Cloud LoadBalancer with Zookeeper

Spring Cloud Zookeeper 提供了 Spring Cloud LoadBalancer ServiceInstanceListSupplier 的实现。在您使用 spring-cloud-starter-zookeeper-discovery 时,Spring Cloud LoadBalancer 默认配置为使用 ZookeeperServiceInstanceListSupplier

如果您之前在 Zookeeper 中使用了 StickyRule,那么它在当前堆栈中的替代品是 SC LoadBalancer 中的 SameInstancePreferenceServiceInstanceListSupplier。您可以在 Spring Cloud Commons documentation 中阅读如何设置它的内容。