grpc-ecosystem / grpc-ecosystem/grpc-spring
why in GrpcMetadataZookeeperConfiguration setPort(0)
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Description
when i use client and server in one project (**if i just only use grpc-server-spring-boot-starter ,i did not get this problem**)
I find GrpcMetadataZookeeperConfiguration will set port 0
but I want remove this line , because i want use what port i set in config file
`zookeeperRegistration.setPort(0);`
```@PostConstruct
public void init() {
if (zookeeperRegistration != null) {
final int port = grpcServerProperties.getPort();
zookeeperRegistration.setPort(0);
if (GrpcUtils.INTER_PROCESS_DISABLE != port) {
zookeeperRegistration.getServiceInstance().getPayload().getMetadata()
.put(GrpcUtils.CLOUD_DISCOVERY_METADATA_PORT, Integer.toString(port));
}
}
}
```
can anyone explain this line why?
Contributor guide
Assessment
This issue has not been assessed yet.