Skip to content

Commit

Permalink
Just use tlsUrl when brokerClientTlsEnable
Browse files Browse the repository at this point in the history
  • Loading branch information
shibd committed Jul 3, 2024
1 parent 633ae45 commit 8e47ed4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1472,8 +1472,13 @@ public CompletableFuture<Boolean> checkNonPersistentNonPartitionedTopicExists(St
"No broker was available to own " + topicName));
}
LookupData lookupData = lookupResult.get().getLookupData();
String brokerUrl = StringUtils.isNotEmpty(lookupData.getBrokerUrlTls())
? lookupData.getBrokerUrlTls() : lookupData.getBrokerUrl();
String brokerUrl;
if (pulsar.getConfiguration().isBrokerClientTlsEnabled()
&& StringUtils.isNotEmpty(lookupData.getBrokerUrlTls())) {
brokerUrl = lookupData.getBrokerUrlTls();
} else {
brokerUrl = lookupData.getBrokerUrl();
}
return pulsarClient.getLookup(brokerUrl)
.getPartitionedTopicMetadata(topicName, false)
.thenApply(metadata -> true)
Expand Down

0 comments on commit 8e47ed4

Please sign in to comment.