將 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 文件中閱讀如何設定它。 |