Skip to content

Commit

Permalink
[fix] [admin] Fix lookup get a null result if uses proxy (#23556)
Browse files Browse the repository at this point in the history
(cherry picked from commit c53a85e)
  • Loading branch information
poorbarcode committed Nov 5, 2024
1 parent 4f18538 commit 2994584
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import javax.ws.rs.client.WebTarget;
import org.apache.commons.lang3.StringUtils;
import org.apache.pulsar.client.admin.Lookup;
import org.apache.pulsar.client.admin.PulsarAdminException;
import org.apache.pulsar.client.admin.Topics;
Expand Down Expand Up @@ -57,7 +58,8 @@ public CompletableFuture<String> lookupTopicAsync(String topic) {
WebTarget path = v2lookup.path(prefix).path(topicName.getLookupName());

return asyncGetRequest(path, new FutureCallback<LookupData>() {})
.thenApply(lookupData -> useTls ? lookupData.getBrokerUrlTls() : lookupData.getBrokerUrl());
.thenApply(lookupData -> useTls && StringUtils.isNotBlank(lookupData.getBrokerUrlTls())
? lookupData.getBrokerUrlTls() : lookupData.getBrokerUrl());
}

@Override
Expand Down

0 comments on commit 2994584

Please sign in to comment.