Skip to content

Commit

Permalink
Merge pull request #462 from hxmhlt/fix_subscribe_bug
Browse files Browse the repository at this point in the history
Fix: bug of subscribe
  • Loading branch information
pantianying authored Apr 3, 2020
2 parents cbf0dfd + dd86265 commit e8881b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
4 changes: 1 addition & 3 deletions registry/etcdv3/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.DEFAULT_CATEGORY, svc.Service()), r.dataListener)

return configListener, nil
}
5 changes: 1 addition & 4 deletions registry/kubernetes/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"fmt"
"os"
"path"
"strings"
"sync"
"time"
)
Expand Down Expand Up @@ -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.DEFAULT_CATEGORY, svc.Service()), r.dataListener)

return configListener, nil
}
Expand Down
5 changes: 1 addition & 4 deletions registry/zookeeper/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package zookeeper
import (
"fmt"
"net/url"
"strings"
"sync"
"time"
)
Expand Down Expand Up @@ -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.DEFAULT_CATEGORY, url.QueryEscape(conf.Service())), r.dataListener)

return zkListener, nil
}

0 comments on commit e8881b9

Please sign in to comment.