315157973 commented on a change in pull request #10961:
URL: https://github.com/apache/pulsar/pull/10961#discussion_r688380954
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -1362,7 +1362,7 @@ public ShutdownService getShutdownService() {
protected String brokerUrl(ServiceConfiguration config) {
if (config.getBrokerServicePort().isPresent()) {
- return
brokerUrl(ServiceConfigurationUtils.getAppliedAdvertisedAddress(config),
+ return
brokerUrl(ServiceConfigurationUtils.getAppliedAdvertisedAddress(config, true),
Review comment:
Obtained from the commit record, the earliest logic is as follows
```
public static String advertisedAddress(ServiceConfiguration config) {
return
ServiceConfigurationUtils.getDefaultOrConfiguredAddress(config.getAdvertisedAddress());
}
private String brokerUrl(ServiceConfiguration config) {
if (config.getBrokerServicePort().isPresent()) {
return brokerUrl(advertisedAddress(config),
getBrokerListenPort().get());
} else {
return null;
}
}
public static String brokerUrl(String host, int port) {
return String.format("pulsar://%s:%d", host, port);
}
```
The order of IP address acquisition is: advertisedAddress, hostname
And the port is get from `brokerServicePort` in ServiceConfiguration, not
from advertisedListener.
So there's no change in the original behavior
https://github.com/apache/pulsar/blob/05827aeb4b0aa4a1b09a7a122f00a65012bf53a1/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L415-L425
@BewareMyPower Please correct me if I get this wrong
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]