merlimat commented on issue #4018: Support multi-host for pulsar-admin
URL: https://github.com/apache/pulsar/pull/4018#issuecomment-492065683
 
 
   ```
   while (true) {
               InetSocketAddress address = serviceNameResolver.resolveHost();
               URI requestUri = replaceWithNew(address, jerseyRequest.getUri());
               jerseyRequest.setUri(requestUri);
               CompletableFuture<ClientResponse> tempFuture = new 
CompletableFuture<>();
               try {
                   resolveRequest(tempFuture, jerseyRequest);
                   if (System.currentTimeMillis() - startTime > 
httpClient.getConfig().getRequestTimeout()) {
                       throw new ProcessingException(
                           "Request timeout, the last try service url is : " + 
jerseyRequest.getUri().toString());
                   }
               } catch (ExecutionException ex) {
                   if (System.currentTimeMillis() - startTime > 
httpClient.getConfig().getRequestTimeout()) {
                       Throwable e = ex.getCause() == null ? ex : ex.getCause();
                       throw new ProcessingException((e.getMessage()), e);
                   }
                   continue;
               } catch (Exception e) {
                   if (System.currentTimeMillis() - startTime > 
httpClient.getConfig().getRequestTimeout()) {
                       throw new ProcessingException(e.getMessage(), e);
                   }
                   continue;
               }
               future = tempFuture;
               break;
           }
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to