Skip to content

Commit

Permalink
Merge pull request #1056 from kzhan/feature/nacos_consumer_subscribe
Browse files Browse the repository at this point in the history
fix:nacos service provider does not require subscribe
  • Loading branch information
AlexStocks authored Feb 23, 2021
2 parents 24e0d8c + e6dd108 commit 5db3ebf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions registry/nacos/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 5db3ebf

Please sign in to comment.