You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/16 10:55:30 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #14706: Process maxRedeliverCount is 0 of DeadLeddterPolicy

codelipenghui commented on a change in pull request #14706:
URL: https://github.com/apache/pulsar/pull/14706#discussion_r827876211



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBuilderImpl.java
##########
@@ -437,6 +437,12 @@ public ConsumerBuilderImpl(PulsarClientImpl client, Schema<T> schema) {
             if (conf.getAckTimeoutMillis() == 0) {
                 conf.setAckTimeoutMillis(DEFAULT_ACK_TIMEOUT_MILLIS_FOR_DEAD_LETTER);
             }
+
+            // when MaxRedeliverCount <= 0 in DeadLetterPolicy, we reset MaxRedeliverCount
+            // to default value, Default: 16.
+            if (deadLetterPolicy.getMaxRedeliverCount() <= 0) {
+                deadLetterPolicy.setMaxRedeliverCount(RetryMessageUtil.MAX_RECONSUMETIMES);

Review comment:
       It's better to add a warn log here to show users which value is applied.
   
   And need an unit test to make sure we will not break here.




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org