Skip to content

Commit

Permalink
Revert "[fix][broker] Fix web tls url null cause NPE (#21137)"
Browse files Browse the repository at this point in the history
This reverts commit 34de125.
  • Loading branch information
Technoboy- committed Sep 12, 2023
1 parent b76118c commit 7022606
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.apache.avro.io.DecoderFactory;
import org.apache.bookkeeper.mledger.ManagedLedgerException;
import org.apache.bookkeeper.mledger.impl.PositionImpl;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.pulsar.broker.admin.impl.PersistentTopicsBase;
import org.apache.pulsar.broker.authentication.AuthenticationParameters;
Expand Down Expand Up @@ -432,10 +431,8 @@ private CompletableFuture<Void> lookUpBrokerForTopic(TopicName partitionedTopicN
}

LookupResult result = optionalResult.get();
String httpUrl = result.getLookupData().getHttpUrl();
String httpUrlTls = result.getLookupData().getHttpUrlTls();
if ((StringUtils.isNotBlank(httpUrl) && httpUrl.equals(pulsar().getWebServiceAddress()))
|| (StringUtils.isNotBlank(httpUrlTls) && httpUrlTls.equals(pulsar().getWebServiceAddressTls()))) {
if (result.getLookupData().getHttpUrl().equals(pulsar().getWebServiceAddress())
|| result.getLookupData().getHttpUrlTls().equals(pulsar().getWebServiceAddressTls())) {
// Current broker owns the topic, add to owning topic.
if (log.isDebugEnabled()) {
log.debug("Complete topic look up for rest produce message request for topic {}, "
Expand All @@ -456,10 +453,12 @@ private CompletableFuture<Void> lookUpBrokerForTopic(TopicName partitionedTopicN
}
if (result.isRedirect()) {
// Redirect lookup.
completeLookup(Pair.of(Arrays.asList(httpUrl, httpUrlTls), false), redirectAddresses, future);
completeLookup(Pair.of(Arrays.asList(result.getLookupData().getHttpUrl(),
result.getLookupData().getHttpUrlTls()), false), redirectAddresses, future);
} else {
// Found owner for topic.
completeLookup(Pair.of(Arrays.asList(httpUrl, httpUrlTls), true), redirectAddresses, future);
completeLookup(Pair.of(Arrays.asList(result.getLookupData().getHttpUrl(),
result.getLookupData().getHttpUrlTls()), true), redirectAddresses, future);
}
}
}).exceptionally(exception -> {
Expand Down

This file was deleted.

0 comments on commit 7022606

Please sign in to comment.