Client implementation

The usage on the client side is the same as for other Spring Cloud projects related to service discovery. The application main class, or @Configuration class, should be annotated with @EnableDiscoveryClient. The default service name, instance ID, and port are taken from spring.application.name, the Spring Context ID, and server.port, respectively. Sample application source code is available in the GitHub repository at https://github.com/piomin/sample-spring-cloud-zookeeper.git. Fundamentally, it is no different than the sample system introduced for Consul, other than the dependency on Spring Cloud Zookeeper Discovery. It still consists of four microservices, which communicate with each other. Now, after cloning the repository, ...

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.