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/06/17 06:03:25 UTC

[rocketmq-client-go] branch master updated: (fix): wrap topic with namespace when unsubscribe (#680)

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 de657f5  (fix): wrap topic with namespace when unsubscribe (#680)
de657f5 is described below

commit de657f5ff1bfee6b2d6e54ad5e5135041e374e04
Author: Robin Han <ha...@gmail.com>
AuthorDate: Thu Jun 17 14:03:14 2021 +0800

    (fix): wrap topic with namespace when unsubscribe (#680)
---
 consumer/push_consumer.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/consumer/push_consumer.go b/consumer/push_consumer.go
index 519ba36..efd373f 100644
--- a/consumer/push_consumer.go
+++ b/consumer/push_consumer.go
@@ -250,6 +250,9 @@ func (pc *pushConsumer) Subscribe(topic string, selector MessageSelector,
 }
 
 func (pc *pushConsumer) Unsubscribe(topic string) error {
+	if pc.option.Namespace != "" {
+		topic = pc.option.Namespace + "%" + topic
+	}
 	pc.subscriptionDataTable.Delete(topic)
 	retryTopic := internal.GetRetryTopic(pc.consumerGroup)
 	pc.subscriptionDataTable.Delete(retryTopic)