You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "chickenlj (via GitHub)" <gi...@apache.org> on 2023/08/16 08:38:34 UTC
[GitHub] [dubbo-go] chickenlj commented on a diff in pull request #2374: Nacos support subscribe to all with '*'
chickenlj commented on code in PR #2374:
URL: https://github.com/apache/dubbo-go/pull/2374#discussion_r1295569762
##########
registry/nacos/registry.go:
##########
@@ -169,36 +169,95 @@ func (nr *nacosRegistry) Subscribe(url *common.URL, notifyListener registry.Noti
if role != common.CONSUMER {
return nil
}
+ serviceName := getServiceName(url)
+ if serviceName == "*" {
+ // Subscribe to all services
+ for {
+ if !nr.IsAvailable() {
+ logger.Warnf("event listener game over.")
+ return perrors.New("nacosRegistry is not available.")
+ }
- for {
- if !nr.IsAvailable() {
- logger.Warnf("event listener game over.")
- return perrors.New("nacosRegistry is not available.")
- }
+ services, err := nr.getAllSubscribeServiceNames()
Review Comment:
Do we need a scheduled pulling task here? What if the service name list in Nacos server changes after we subscribed to '*', for example, if a new service name is registered, will we still get notified by subscribing to '*'?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org