You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/02/23 15:27:48 UTC

[dubbo-go] branch develop updated: fix:nacos service provider does not require subscribe

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

alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
     new e6dd108  fix:nacos service provider does not require subscribe
     new 5db3ebf  Merge pull request #1056 from kzhan/feature/nacos_consumer_subscribe
e6dd108 is described below

commit e6dd10891ff47e6d9113a06c20031c3bdb56fcce
Author: kezhan <ke...@shizhuang-inc.com>
AuthorDate: Tue Feb 16 12:56:54 2021 +0800

    fix:nacos service provider does not require subscribe
---
 registry/nacos/registry.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/registry/nacos/registry.go b/registry/nacos/registry.go
index de68e74..e9a4bd3 100644
--- a/registry/nacos/registry.go
+++ b/registry/nacos/registry.go
@@ -172,6 +172,11 @@ func (nr *nacosRegistry) subscribe(conf *common.URL) (registry.Listener, error)
 
 // subscribe from registry
 func (nr *nacosRegistry) Subscribe(url *common.URL, notifyListener registry.NotifyListener) error {
+	role, _ := strconv.Atoi(nr.URL.GetParam(constant.ROLE_KEY, ""))
+	if role != common.CONSUMER {
+		return nil
+	}
+
 	for {
 		if !nr.IsAvailable() {
 			logger.Warnf("event listener game over.")