跳到主要内容

在 Spring Cloud 组件中使用 Spring Cloud Zookeeper

TranslateGemma 中英对照 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 文档 中了解如何设置它。