将 Spring Cloud Zookeeper 与 Spring Cloud 组件结合使用
Feign、Spring Cloud Gateway 和 Spring Cloud LoadBalancer 都与 Spring Cloud Zookeeper 兼容。
Spring Cloud LoadBalancer 与 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 文档中阅读如何设置它。 |