rdhabalia closed pull request #1946: Use broker advertisedAddress + tls url in 
function worker
URL: https://github.com/apache/incubator-pulsar/pull/1946
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java
index 2a0e1a22e9..24e3fda71e 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java
@@ -144,8 +144,15 @@ private static boolean argsContains(String[] args, String 
arg) {
                     workerConfig = 
WorkerConfig.load(starterArguments.fnWorkerConfigFile);
                 }
                 // worker talks to local broker
-                workerConfig.setPulsarServiceUrl("pulsar://127.0.0.1:" + 
brokerConfig.getBrokerServicePort());
-                workerConfig.setPulsarWebServiceUrl("http://127.0.0.1:"; + 
brokerConfig.getWebServicePort());
+                boolean useTls = workerConfig.isUseTls();
+                String pulsarServiceUrl = useTls && 
isNotBlank(PulsarService.brokerUrlTls(brokerConfig))
+                        ? PulsarService.brokerUrlTls(brokerConfig)
+                        : PulsarService.brokerUrl(brokerConfig);
+                String webServiceUrl = useTls && 
isNotBlank(PulsarService.webAddressTls(brokerConfig))
+                        ? PulsarService.webAddressTls(brokerConfig)
+                        : PulsarService.webAddress(brokerConfig);
+                workerConfig.setPulsarServiceUrl(pulsarServiceUrl);
+                workerConfig.setPulsarWebServiceUrl(webServiceUrl);
                 String hostname = 
ServiceConfigurationUtils.getDefaultOrConfiguredAddress(
                     brokerConfig.getAdvertisedAddress());
                 workerConfig.setWorkerHostname(hostname);


 

----------------------------------------------------------------
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

Reply via email to