spring-cloud / spring-cloud/spring-cloud-zookeeper

Spring Cloud ZooKeeper Discovery Client Not Register on ZooKeeper when using SpringBootServletInitializer

Open
#158 13 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement icebox
Dominant language
Java
Stars
574
Forks
408
Avg merge
1d 12h
Merged PRs (30d)
4

Description

I have a spring boot application that use spring-cloud-stater-zookeeper-discovery to register the service, but it doesn't work.

  1. the application is deployed as a WAR.

     @SpringBootConfiguration
     @EnableAutoConfiguration
     @EnableDiscoveryClient
     public class MyApplication extends SpringBootServletInitializer {
     
         @Override
         protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
             return application.sources(MyApplication.class)
                     .properties("spring.cloud.zookeeper.discovery.instance-host=" + getHostName())
                     .web(true);
         }
     }
     
  2. the application has connected to the zookeeper instance. Ping messages to zookeeper can be seen in the application's log and the output of STAT command shows a connected zookeeper client.

  3. the application does not register watchers to appointed zookeeper path, i.e., /services. This can be confirmed by sending WCHC command to the zookeeper.

Spring Boot version: 1.5.9

spring-cloud-stater-zookeeper-discovery: 1.2.0.RELEASE

web container: tomcat 8.5.23

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by reproducing the WAR deployment with Spring Boot 1.5.9, Spring Cloud Zookeeper Discovery 1.2.0.RELEASE, and Tomcat 8.5.23, then trace discovery initialization and registration. Done means the deployed application registers its service and watchers under the configured ZooKeeper path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.