BewareMyPower commented on code in PR #139:
URL: https://github.com/apache/pulsar-client-cpp/pull/139#discussion_r1062248819


##########
lib/ConsumerImpl.cc:
##########
@@ -527,6 +544,10 @@ void ConsumerImpl::messageReceived(const 
ClientConnectionPtr& cnx, const proto::
                                 << startMessageId.value());
             return;
         }
+        if (redeliveryCount >= deadLetterPolicy_.getMaxRedeliverCount()) {
+            possibleSendToDeadLetterTopicMessages_.emplace(m.getMessageId(), 
std::vector<Message>{m});
+            increaseAvailablePermits(cnx);

Review Comment:
   ```suggestion
               if (redeliveryCount > deadLetterPolicy_.getMaxRedeliverCount()) {
                   increaseAvailablePermits(cnx);
               }
   ```
   
   See the Java implementation 
[here](https://github.com/apache/pulsar/pull/17287/files#diff-f6e4c1c4091aa10525f331e48e66b29f22b9f7987755c1b4fb887e24f198bed6).
   
   And should we call `redeliverUnacknowledgedMessages` here as well?



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