315157973 commented on a change in pull request #8143:
URL: https://github.com/apache/pulsar/pull/8143#discussion_r502755632
##########
File path:
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/PulsarAdmin.java
##########
@@ -189,7 +191,11 @@ public PulsarAdmin(String serviceUrl,
this.client = clientBuilder.build();
this.serviceUrl = serviceUrl;
- root = client.target(serviceUrl);
+ ServiceURI serviceUri = ServiceURI.create(serviceUrl);
+ root = client.target(String.format("%s://%s"
+ , serviceUri.getServiceScheme()
+ , serviceUri.getServiceHosts()[ThreadLocalRandom.current()
+ .nextInt(serviceUri.getServiceHosts().length)]));
Review comment:
> I have a little doubt. Is this fixed the problem that the pulsar
function does not support multi-service URLs?
Yes, when we create a Function, the Client initiates a request. Since
multi-service URLs are not supported here, a `NumberFormatException` will be
thrown.
When you restore this code, then update the jar to the lib, create a
Function with cli, you can reproduce the previous bug.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]