315157973 commented on a change in pull request #11597:
URL: https://github.com/apache/pulsar/pull/11597#discussion_r684873832



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBuilderImpl.java
##########
@@ -122,11 +124,17 @@ public ConsumerBuilderImpl(PulsarClientImpl client, 
Schema<T> schema) {
             //Issue 9327: do compatibility check in case of the default retry 
and dead letter topic name changed
             String oldRetryLetterTopic = topicFirst.getNamespace() + "/" + 
conf.getSubscriptionName() + RetryMessageUtil.RETRY_GROUP_TOPIC_SUFFIX;
             String oldDeadLetterTopic = topicFirst.getNamespace() + "/" + 
conf.getSubscriptionName() + RetryMessageUtil.DLQ_GROUP_TOPIC_SUFFIX;
-            if 
(client.getPartitionedTopicMetadata(oldRetryLetterTopic).join().partitions > 0) 
{
-                retryLetterTopic = oldRetryLetterTopic;
-            }
-            if 
(client.getPartitionedTopicMetadata(oldDeadLetterTopic).join().partitions > 0) {
-                deadLetterTopic = oldDeadLetterTopic;
+            try {
+                if (client.getPartitionedTopicMetadata(oldRetryLetterTopic)
+                        .get(client.conf.getOperationTimeoutMs(), 
TimeUnit.MILLISECONDS).partitions > 0) {
+                    retryLetterTopic = oldRetryLetterTopic;
+                }
+                if (client.getPartitionedTopicMetadata(oldDeadLetterTopic)
+                        .get(client.conf.getOperationTimeoutMs(), 
TimeUnit.MILLISECONDS).partitions > 0) {
+                    deadLetterTopic = oldDeadLetterTopic;
+                }
+            } catch (InterruptedException | TimeoutException | 
ExecutionException e) {
+                return FutureUtil.failedFuture(e);

Review comment:
       Done




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to