You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2021/03/08 12:18:59 UTC

[rocketmq-client-go] branch master updated: [ISSUE #615]putmessage should check msg in consumingMsgOrderlyTreeMap

This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new c6a3148  [ISSUE #615]putmessage should check msg in consumingMsgOrderlyTreeMap
c6a3148 is described below

commit c6a314851f8c90cbf753d43d683b22ab0e8bf009
Author: Fei Yang <14...@qq.com>
AuthorDate: Mon Mar 8 20:18:51 2021 +0800

    [ISSUE #615]putmessage should check msg in consumingMsgOrderlyTreeMap
    
    close https://github.com/apache/rocketmq-client-go/issues/615
---
 consumer/process_queue.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/consumer/process_queue.go b/consumer/process_queue.go
index aab3522..19e831b 100644
--- a/consumer/process_queue.go
+++ b/consumer/process_queue.go
@@ -98,6 +98,10 @@ func (pq *processQueue) putMessage(messages ...*primitive.MessageExt) {
 		if found {
 			continue
 		}
+		_, found = pq.consumingMsgOrderlyTreeMap.Get(msg.QueueOffset)
+		if found {
+			continue
+		}
 		pq.msgCache.Put(msg.QueueOffset, msg)
 		validMessageCount++
 		pq.queueOffsetMax = msg.QueueOffset