You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/08/31 06:36:59 UTC

[GitHub] [rocketmq] lollipopjin commented on a diff in pull request #4940: [ISSUE #4938, ISSUE #4939] fix the concurrency problems and limit the times of renew when some error occurred in ReceiptHandleProcessor

lollipopjin commented on code in PR #4940:
URL: https://github.com/apache/rocketmq/pull/4940#discussion_r959199154


##########
proxy/src/main/java/org/apache/rocketmq/proxy/common/MessageReceiptHandle.java:
##########
@@ -27,24 +29,26 @@ public class MessageReceiptHandle {
     private final String messageId;
     private final long queueOffset;
     private final String originalReceiptHandle;
-    private final long timestamp;
     private final int reconsumeTimes;
-    private final long expectInvisibleTime;
 
-    private String receiptHandle;
+    private final AtomicInteger renewRetryTimes = new AtomicInteger(0);
+    private long timestamp;
+    private long expectInvisibleTime;
+    private volatile String receiptHandle;
 
-    public MessageReceiptHandle(String group, String topic, int queueId, String receiptHandle, String messageId,
-        long queueOffset, int reconsumeTimes, long expectInvisibleTime) {
+    public MessageReceiptHandle(String group, String topic, int queueId, String receiptHandleStr, String messageId,
+        long queueOffset, int reconsumeTimes) {
+        ReceiptHandle receiptHandle = ReceiptHandle.decode(receiptHandleStr);
         this.group = group;
         this.topic = topic;
         this.queueId = queueId;
-        this.receiptHandle = receiptHandle;
-        this.originalReceiptHandle = receiptHandle;
+        this.receiptHandle = receiptHandleStr;

Review Comment:
   Can here rename to receiptHandleStr for avoiding confusion with ReceiptHandle receiptHandle



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

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