"ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services."
See the Zookeeper site for more information. Spring Cloud Zookeeper also builds on the Apache Curator project which started life at Netflix.
-
Spring Cloud
DiscoveryClientimplementation-
supports Ribbon and Zuul
-
-
Zookeeper based
PropertySourceloaded during the 'bootstrap' phase.
-
Install zookeeper (On a mac with homebrew
brew install zookeeper). -
Run
mvn --settings .settings.xml packagethis will bring in the required spring cloud maven repositories and build -
Run
java -jar spring-cloud-zookeeper-sample/target/spring-cloud-zookeeper-sample-1.0.5.BUILD-SNAPSHOT.jar -
Visit http://localhost:8080, verify that
{"serviceId":"testZookeeperApp","host":"<yourhost>","port":8080}results -
run
java -jar spring-cloud-zookeeper-sample/target/spring-cloud-zookeeper-sample-1.0.5.BUILD-SNAPSHOT.jar --server.port=8081 -
visit http://localhost:8080 again, verify that
{"serviceId":"testZookeeperApp","host":"<yourhost>","port":8081}eventually shows up in the results in a round robbin fashion (may take a minute or so).