grpc-ecosystem / grpc-ecosystem/grpc-spring

why in GrpcMetadataZookeeperConfiguration setPort(0)

Open
#587 4 comments 0 reactions 0 assignees View on GitHub
question
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.