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/17 06:53:09 UTC
[GitHub] [pulsar] Jason918 commented on a change in pull request #14706: Process maxRedeliverCount is 0 of DeadLeddterPolicy
Jason918 commented on a change in pull request #14706:
URL: https://github.com/apache/pulsar/pull/14706#discussion_r828802980
##########
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:
Maybe a `checkArgument` is better here to keep consistent with other parameter validation. @codelipenghui WDYT
--
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