merlimat commented on a change in pull request #2988: Start Pulsar in TLS Only
mode and deprecate tlsEnabled flag.
URL: https://github.com/apache/pulsar/pull/2988#discussion_r233958267
##########
File path:
pulsar-discovery-service/src/main/java/org/apache/pulsar/discovery/service/server/ServiceConfig.java
##########
@@ -131,42 +132,44 @@ public void setZookeeperSessionTimeoutMs(int
zookeeperSessionTimeoutMs) {
this.zookeeperSessionTimeoutMs = zookeeperSessionTimeoutMs;
}
- public int getServicePort() {
- return servicePort;
+ public Optional<Integer> getServicePort() {
+ return Optional.ofNullable(servicePort);
}
public void setServicePort(int servicePort) {
this.servicePort = servicePort;
}
- public int getServicePortTls() {
- return servicePortTls;
+ public Optional<Integer> getServicePortTls() {
+ return Optional.ofNullable(servicePortTls);
}
public void setServicePortTls(int servicePortTls) {
this.servicePortTls = servicePortTls;
}
- public int getWebServicePort() {
- return webServicePort;
+ public Optional<Integer> getWebServicePort() {
+ return Optional.ofNullable(webServicePort);
}
public void setWebServicePort(int webServicePort) {
this.webServicePort = webServicePort;
}
- public int getWebServicePortTls() {
- return webServicePortTls;
+ public Optional<Integer> getWebServicePortTls() {
+ return Optional.ofNullable(webServicePortTls);
}
public void setWebServicePortTls(int webServicePortTls) {
this.webServicePortTls = webServicePortTls;
}
+ @Deprecated
public boolean isTlsEnabled() {
- return tlsEnabled;
+ return tlsEnabled || webServicePortTls != null || servicePortTls !=
null;
Review comment:
If `tlsEnabled=true` but the port is null, we'll have a problem anyway.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services