Skip to content

Commit

Permalink
[fix] [admin] Fix lookup get a null result if uses proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode committed Nov 4, 2024
1 parent 570cb44 commit e6df03d
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 e6df03d

Please sign in to comment.