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/16 11:41:55 UTC

[rocketmq-client-go] branch master updated: [ISSUE #611] Fix restart the same push consumer failed (#612)

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 7468d87  [ISSUE #611] Fix restart the same push consumer failed (#612)
7468d87 is described below

commit 7468d87886c27d630bf8d0690c415da43ad6c72f
Author: 张旭 <ma...@gmail.com>
AuthorDate: Tue Mar 16 19:41:48 2021 +0800

    [ISSUE #611] Fix restart the same push consumer failed (#612)
    
    * Fix restart push consumer failed
---
 internal/client.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/internal/client.go b/internal/client.go
index bc523ab..bf0437a 100644
--- a/internal/client.go
+++ b/internal/client.go
@@ -414,11 +414,19 @@ func (c *rmqClient) Start() {
 	})
 }
 
+func (c *rmqClient) removeClient() {
+	rlog.Info("will remove client from clientMap", map[string]interface{}{
+		"clientID": c.ClientID(),
+	})
+	clientMap.Delete(c.ClientID())
+}
+
 func (c *rmqClient) Shutdown() {
 	c.shutdownOnce.Do(func() {
 		close(c.done)
 		c.close = true
 		c.remoteClient.ShutDown()
+		c.removeClient()
 	})
 }