Skip to content
Snippets Groups Projects
Commit 41db66f5 authored by vito.he's avatar vito.he
Browse files

Fix: bug of subscribe

parent cbf0dfd9
No related branches found
No related tags found
No related merge requests found
...@@ -164,9 +164,7 @@ func (r *etcdV3Registry) DoSubscribe(svc *common.URL) (registry.Listener, error) ...@@ -164,9 +164,7 @@ func (r *etcdV3Registry) DoSubscribe(svc *common.URL) (registry.Listener, error)
//register the svc to dataListener //register the svc to dataListener
r.dataListener.AddInterestedURL(svc) r.dataListener.AddInterestedURL(svc)
for _, v := range strings.Split(svc.GetParam(constant.CATEGORY_KEY, constant.DEFAULT_CATEGORY), ",") { go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+constant.PROVIDER_PROTOCOL, svc.Service()), r.dataListener)
go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+v, svc.Service()), r.dataListener)
}
return configListener, nil return configListener, nil
} }
...@@ -21,7 +21,6 @@ import ( ...@@ -21,7 +21,6 @@ import (
"fmt" "fmt"
"os" "os"
"path" "path"
"strings"
"sync" "sync"
"time" "time"
) )
...@@ -135,9 +134,7 @@ func (r *kubernetesRegistry) DoSubscribe(svc *common.URL) (registry.Listener, er ...@@ -135,9 +134,7 @@ func (r *kubernetesRegistry) DoSubscribe(svc *common.URL) (registry.Listener, er
//register the svc to dataListener //register the svc to dataListener
r.dataListener.AddInterestedURL(svc) r.dataListener.AddInterestedURL(svc)
for _, v := range strings.Split(svc.GetParam(constant.CATEGORY_KEY, constant.DEFAULT_CATEGORY), ",") { go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+constant.PROVIDER_PROTOCOL, svc.Service()), r.dataListener)
go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+v, svc.Service()), r.dataListener)
}
return configListener, nil return configListener, nil
} }
......
...@@ -20,7 +20,6 @@ package zookeeper ...@@ -20,7 +20,6 @@ package zookeeper
import ( import (
"fmt" "fmt"
"net/url" "net/url"
"strings"
"sync" "sync"
"time" "time"
) )
...@@ -217,9 +216,7 @@ func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListen ...@@ -217,9 +216,7 @@ func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListen
//Interested register to dataconfig. //Interested register to dataconfig.
r.dataListener.AddInterestedURL(conf) r.dataListener.AddInterestedURL(conf)
for _, v := range strings.Split(conf.GetParam(constant.CATEGORY_KEY, constant.DEFAULT_CATEGORY), ",") { go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+constant.PROVIDER_PROTOCOL, url.QueryEscape(conf.Service())), r.dataListener)
go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+v, url.QueryEscape(conf.Service())), r.dataListener)
}
return zkListener, nil return zkListener, nil
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment