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

Fix: bug of subscribe

parent 9340e82e
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)
//register the svc to dataListener
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/"+v, svc.Service()), r.dataListener)
}
go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+constant.PROVIDER_PROTOCOL, svc.Service()), r.dataListener)
return configListener, nil
}
......@@ -21,7 +21,6 @@ import (
"fmt"
"os"
"path"
"strings"
"sync"
"time"
)
......@@ -135,9 +134,7 @@ func (r *kubernetesRegistry) DoSubscribe(svc *common.URL) (registry.Listener, er
//register the svc to dataListener
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/"+v, svc.Service()), r.dataListener)
}
go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+constant.PROVIDER_PROTOCOL, svc.Service()), r.dataListener)
return configListener, nil
}
......
......@@ -20,7 +20,6 @@ package zookeeper
import (
"fmt"
"net/url"
"strings"
"sync"
"time"
)
......@@ -217,9 +216,7 @@ func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListen
//Interested register to dataconfig.
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/"+v, url.QueryEscape(conf.Service())), r.dataListener)
}
go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+constant.PROVIDER_PROTOCOL, url.QueryEscape(conf.Service())), r.dataListener)
return zkListener, nil
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment