You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/21 18:37:40 UTC
[GitHub] [pulsar] klwilson227 commented on a change in pull request #9260: [Functions] Can't create functions with m-TLS
klwilson227 commented on a change in pull request #9260:
URL: https://github.com/apache/pulsar/pull/9260#discussion_r562094741
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -1316,19 +1323,24 @@ private void startPackagesManagementService() throws IOException {
public static WorkerConfig initializeWorkerConfigFromBrokerConfig(ServiceConfiguration brokerConfig,
String workerConfigFile) throws IOException {
WorkerConfig workerConfig = WorkerConfig.load(workerConfigFile);
+
+ brokerConfig.getWebServicePort()
+ .map(port -> workerConfig.setWorkerPort(port));
+ brokerConfig.getWebServicePortTls()
+ .map(port -> workerConfig.setWorkerPortTls(port));
+
// worker talks to local broker
String hostname = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(
brokerConfig.getAdvertisedAddress());
workerConfig.setWorkerHostname(hostname);
- workerConfig.setWorkerPort(brokerConfig.getWebServicePort().get());
workerConfig.setWorkerId(
"c-" + brokerConfig.getClusterName()
+ "-fw-" + hostname
- + "-" + workerConfig.getWorkerPort());
+ + "-" + (workerConfig.getWorkerPort() != null
+ ? workerConfig.getWorkerPort() : workerConfig.getWorkerPortTls()));
Review comment:
workerConfig.getTlsEnabled() ? workerConfig.getWorkerPort(): workerConfig.getWokerPortTls()
I believe would be consistent with the usage of TLS. Infering from the fact that the config has setup the port or not may lead to differences between the usage and the naming...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org