codelipenghui commented on code in PR #17082:
URL: https://github.com/apache/pulsar/pull/17082#discussion_r945207831
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java:
##########
@@ -493,13 +494,39 @@ private URI getRedirectionUrl(ClusterData
differentClusterData) throws Malformed
} else {
serviceNameResolver.updateServiceUrl(differentClusterData.getServiceUrl());
}
- URL webUrl = new
URL(serviceNameResolver.resolveHostUri().toString());
+ URL webUrl = getConnectableURL(serviceNameResolver);
return
UriBuilder.fromUri(uri.getRequestUri()).host(webUrl.getHost()).port(webUrl.getPort()).build();
} catch (PulsarClientException.InvalidServiceURL exception) {
throw new MalformedURLException(exception.getMessage());
}
}
+ private URL getConnectableURL(PulsarServiceNameResolver
serviceNameResolver) throws MalformedURLException {
Review Comment:
We should make this method pure async. This is called from the metadata
callback thread.
--
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]