This is an automated email from the ASF dual-hosted git repository.

rdhabalia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 2bf387d  Use broker advertisedAddress + tls url in function worker 
(#1946)
2bf387d is described below

commit 2bf387d00262db38754ca804956cd83fccd4c512
Author: Rajan Dhabalia <rdhaba...@apache.org>
AuthorDate: Fri Jun 8 17:36:07 2018 -0700

    Use broker advertisedAddress + tls url in function worker (#1946)
---
 .../src/main/java/org/apache/pulsar/PulsarBrokerStarter.java  | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

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 2a0e1a2..24e3fda 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 @@ public class PulsarBrokerStarter {
                     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);

-- 
To stop receiving notification emails like this one, please contact
rdhaba...@apache.org.

Reply via email to