codelipenghui commented on a change in pull request #5915: Allow to 
enable/disable delayed delivery for messages on namespace
URL: https://github.com/apache/pulsar/pull/5915#discussion_r363264482
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
 ##########
 @@ -718,7 +718,7 @@ public void 
initializeDispatchRateLimiterIfNeeded(Optional<Policies> policies) {
 
     @Override
     public boolean trackDelayedDelivery(long ledgerId, long entryId, 
MessageMetadata msgMetadata) {
-        if (!isDelayedDeliveryEnabled) {
+        if (!isDelayedDeliveryEnabled || !topic.checkActiveDelayedDelivery()) {
 
 Review comment:
   The isDelayedDeliveryEnabled in the dispatcher is for indicating the 
dispatcher is enable or disable delayed delivery. It's better to update this 
field while the delayed delivery policy changed because it's more economic than 
get policy from a hashmap for each message. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to