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 2020/10/10 06:28:34 UTC

[GitHub] [pulsar] jianyun8023 commented on a change in pull request #8143: [ISSUE 6408] Fix NumberFormatException

jianyun8023 commented on a change in pull request #8143:
URL: https://github.com/apache/pulsar/pull/8143#discussion_r502753616



##########
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?




----------------------------------------------------------------
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:
users@infra.apache.org