From f8ac225411058de0c62733ae8c0634e79b3c1ed9 Mon Sep 17 00:00:00 2001 From: huangli Date: Wed, 27 Jan 2021 20:21:26 +0800 Subject: [PATCH] [ISSUE #2449] resetOffset simultaneously will cause each message consume more than once. --- .../apache/rocketmq/client/impl/factory/MQClientInstance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java b/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java index d40bdc2d..81e6d846 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java @@ -1105,7 +1105,7 @@ public class MQClientInstance { return null; } - public void resetOffset(String topic, String group, Map offsetTable) { + public synchronized void resetOffset(String topic, String group, Map offsetTable) { DefaultMQPushConsumerImpl consumer = null; try { MQConsumerInner impl = this.consumerTable.get(group); -- GitLab