spring-cloud / spring-cloud/spring-cloud-zookeeper
Spring Cloud ZooKeeper Discovery Client Not Register on ZooKeeper when using SpringBootServletInitializer
Nobody has claimed this yet.
- 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.
-
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); } } -
the application has connected to the zookeeper instance. Ping messages to zookeeper can be seen in the application's log and the output of
STATcommand shows a connected zookeeper client. -
the application does not register watchers to appointed zookeeper path, i.e.,
/services. This can be confirmed by sendingWCHCcommand 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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