Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ public PulsarService(ServiceConfiguration config,
// the advertised address is defined as the host component of the broker's canonical name.
this.advertisedAddress = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(config.getAdvertisedAddress());

// the broker id is used in the load manager to identify the broker
// it should not be used for making connections to the broker
this.brokerId =
String.format("%s:%s", advertisedAddress, config.getWebServicePort()
.or(config::getWebServicePortTls).orElseThrow());

// use `internalListenerName` listener as `advertisedAddress`
this.bindAddress = ServiceConfigurationUtils.getDefaultOrConfiguredAddress(config.getBindAddress());
this.brokerVersion = PulsarVersion.getVersion();
Expand Down Expand Up @@ -918,12 +924,6 @@ public void start() throws PulsarServerException {
this.brokerServiceUrl = brokerUrl(config);
this.brokerServiceUrlTls = brokerUrlTls(config);

// the broker id is used in the load manager to identify the broker
// it should not be used for making connections to the broker
this.brokerId =
String.format("%s:%s", advertisedAddress, config.getWebServicePort()
.or(config::getWebServicePortTls).orElseThrow());

if (this.compactionServiceFactory == null) {
this.compactionServiceFactory = loadCompactionServiceFactory();
}
Expand Down