4. Using Spring Cloud Zookeeper with Spring Cloud Components
Feign, Spring Cloud Gateway and Spring Cloud LoadBalancer all work with Spring Cloud Zookeeper.
4.1. Spring Cloud LoadBalancer with Zookeeper
Spring Cloud Zookeeper provides an implementation of Spring Cloud LoadBalancer ServiceInstanceListSupplier
.
When you use the spring-cloud-starter-zookeeper-discovery
, Spring Cloud LoadBalancer is autoconfigured to use the
ZookeeperServiceInstanceListSupplier
by default.
If you were previously using the StickyRule in Zookeeper, its replacement in the current stack
is the SameInstancePreferenceServiceInstanceListSupplier in SC LoadBalancer. You can read on how to set it up in the Spring Cloud Commons documentation.
|