lhotari commented on code in PR #25916:
URL: https://github.com/apache/pulsar/pull/25916#discussion_r3339060767


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##########
@@ -1300,8 +1300,10 @@ public CompletableFuture<Void> unsubscribeAsync(String 
topicName) {
                     });
 
                     removeTopic(topicName);
-                    if (unAckedMessageTracker instanceof 
UnAckedTopicMessageTracker) {
-                        ((UnAckedTopicMessageTracker) 
unAckedMessageTracker).removeTopicMessages(topicName);
+                    if (unAckedMessageTracker instanceof 
UnAckedTopicMessageTracker tracker) {
+                        tracker.removeTopicMessages(topicName);
+                    } else if (unAckedMessageTracker instanceof 
UnAckedTopicMessageRedeliveryTracker tracker){
+                        tracker.removeTopicMessages(topicName);
                     }

Review Comment:
   `UnAckedTopicMessageTracker extends UnAckedMessageTracker`, therefore it 
seems that this change is not necessary.



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