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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to