You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "xdkxlk (via GitHub)" <gi...@apache.org> on 2023/03/09 05:45:22 UTC

[GitHub] [rocketmq] xdkxlk commented on a diff in pull request #6271: ReceiptHandleProcessor message renewal strategy optimization

xdkxlk commented on code in PR #6271:
URL: https://github.com/apache/rocketmq/pull/6271#discussion_r1130504861


##########
proxy/src/main/java/org/apache/rocketmq/proxy/processor/ReceiptHandleProcessor.java:
##########
@@ -175,9 +175,10 @@ protected CompletableFuture<MessageReceiptHandle> startRenewMessage(MessageRecei
                 return CompletableFuture.completedFuture(null);
             }
             if (current - messageReceiptHandle.getConsumeTimestamp() < proxyConfig.getRenewMaxTimeMillis()) {
+                RetryPolicy renewPolicy = messageReceiptHandle.getRenewStrategyPolicy();
                 CompletableFuture<AckResult> future =
                     messagingProcessor.changeInvisibleTime(context, handle, messageReceiptHandle.getMessageId(),
-                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), proxyConfig.getRenewSliceTimeMillis());
+                        messageReceiptHandle.getGroup(), messageReceiptHandle.getTopic(), renewPolicy.nextDelayDuration(messageReceiptHandle.getRenewRetryTimes()));

Review Comment:
   We need another counter to save the renew times
   The retry times will be increased when some error occur, and will reset to 0 after success



-- 
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@rocketmq.apache.org

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