Skip to content

Commit

Permalink
Replace the functions worker's hard-coded brokerUrls. (apache#4566)
Browse files Browse the repository at this point in the history
  • Loading branch information
murong00 authored and merlimat committed Jun 20, 2019
1 parent 37476bb commit 4c3cac8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,12 @@ private static class BrokerStarter {
}
// 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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,12 @@ public void start() throws Exception {
}
// 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()) {
Expand Down

0 comments on commit 4c3cac8

Please sign in to comment.