thetumbled commented on code in PR #23918:
URL: https://github.com/apache/pulsar/pull/23918#discussion_r1958987897


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -448,7 +442,10 @@ protected Predicate<Position> 
createReadEntriesSkipConditionForNormalRead() {
         // Filter out and skip read delayed messages exist in 
DelayedDeliveryTracker
         if (delayedDeliveryTracker.isPresent()) {
             final DelayedDeliveryTracker deliveryTracker = 
delayedDeliveryTracker.get();
-            if (deliveryTracker instanceof BucketDelayedDeliveryTracker) {
+            if (deliveryTracker instanceof InMemoryDelayedDeliveryTracker) {
+                skipCondition = position -> ((InMemoryDelayedDeliveryTracker) 
deliveryTracker)
+                        .shouldSkipMessage(position.getLedgerId(), 
position.getEntryId());
+            } else if (deliveryTracker instanceof 
BucketDelayedDeliveryTracker) {
                 skipCondition = position -> ((BucketDelayedDeliveryTracker) 
deliveryTracker)
                         .containsMessage(position.getLedgerId(), 
position.getEntryId());

Review Comment:
   change `shouldSkipMessage`  to `contains` to avoid duplicate code.



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