You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2019/06/20 15:33:13 UTC

[pulsar] branch master updated: Replace the functions worker's hard-coded brokerUrls. (#4566)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4c3cac8  Replace the functions worker's hard-coded brokerUrls. (#4566)
4c3cac8 is described below

commit 4c3cac854a2b60d700f6e1b59ee700b97c0c4b84
Author: Fangbin Sun <su...@gmail.com>
AuthorDate: Thu Jun 20 23:33:08 2019 +0800

    Replace the functions worker's hard-coded brokerUrls. (#4566)
---
 .../src/main/java/org/apache/pulsar/PulsarBrokerStarter.java     | 9 ++++-----
 .../src/main/java/org/apache/pulsar/PulsarStandalone.java        | 9 ++++-----
 2 files changed, 8 insertions(+), 10 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 19570f5..4daa440 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarBrokerStarter.java
@@ -161,13 +161,12 @@ public class PulsarBrokerStarter {
                 }
                 // worker talks to local broker
                 boolean useTls = workerConfig.isUseTls();
-                String localhost = "127.0.0.1";
                 String pulsarServiceUrl = useTls
-                        ? PulsarService.brokerUrlTls(localhost, brokerConfig.getBrokerServicePortTls().get())
-                        : PulsarService.brokerUrl(localhost, brokerConfig.getBrokerServicePort().get());
+                        ? PulsarService.brokerUrlTls(brokerConfig)
+                        : PulsarService.brokerUrl(brokerConfig);
                 String webServiceUrl = useTls
-                        ? PulsarService.webAddressTls(localhost, brokerConfig.getWebServicePortTls().get())
-                        : PulsarService.webAddress(localhost, brokerConfig.getWebServicePort().get());
+                        ? PulsarService.webAddressTls(brokerConfig)
+                        : PulsarService.webAddress(brokerConfig);
                 workerConfig.setPulsarServiceUrl(pulsarServiceUrl);
                 workerConfig.setPulsarWebServiceUrl(webServiceUrl);
                 String hostname = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
index 7fa0d8c..7fdb3c9 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
@@ -273,13 +273,12 @@ public class PulsarStandalone implements AutoCloseable {
             }
             // worker talks to local broker
             boolean useTls = workerConfig.isUseTls();
-            String localhost = "127.0.0.1";
             String pulsarServiceUrl = useTls
-                    ? PulsarService.brokerUrlTls(localhost, config.getBrokerServicePortTls().get())
-                    : PulsarService.brokerUrl(localhost, config.getBrokerServicePort().get());
+                    ? PulsarService.brokerUrlTls(config)
+                    : PulsarService.brokerUrl(config);
             String webServiceUrl = useTls
-                    ? PulsarService.webAddressTls(localhost, config.getWebServicePortTls().get())
-                    : PulsarService.webAddress(localhost, config.getWebServicePort().get());
+                    ? PulsarService.webAddressTls(config)
+                    : PulsarService.webAddress(config);
             workerConfig.setPulsarServiceUrl(pulsarServiceUrl);
             workerConfig.setPulsarWebServiceUrl(webServiceUrl);
             if (this.isNoStreamStorage()) {