You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/09/20 16:08:15 UTC

[GitHub] [pulsar] EronWright commented on a change in pull request #12066: [PIP 95][Issue 12040][broker] Improved multi-listener in standalone mode

EronWright commented on a change in pull request #12066:
URL: https://github.com/apache/pulsar/pull/12066#discussion_r712312488



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java
##########
@@ -294,9 +295,10 @@ protected String internalGetNamespaceBundle(TopicName topicName) {
                                                 newAuthoritative, LookupType.Redirect, requestId, false));
                             } else {
                                 // When running in standalone mode we want to redirect the client through the service
-                                // url, so that the advertised address configuration is not relevant anymore.
-                                boolean redirectThroughServiceUrl = pulsarService.getConfiguration()
-                                        .isRunningStandalone();
+                                // url, if the advertised address is localhost (per PulsarStandaloneStarter).
+                                ServiceConfiguration conf = pulsarService.getConfiguration();
+                                boolean isLocalhost = StringUtils.equals("localhost", conf.getAdvertisedAddress());

Review comment:
       Good idea @eolivelli, I'll use [InetAddress::isLoopbackAddress](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/net/InetAddress.html#isLoopbackAddress()) to test whether the advertised address is a loopback address, in which case we'll force the proxy mode.




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org