Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix:nacos client reuse #1633

Merged
merged 16 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
修复测试用例问题
  • Loading branch information
zhaoyunxing92 committed Dec 30, 2021
commit 7021da83e740f90692892ade9502c6e07000641e
4 changes: 1 addition & 3 deletions remoting/nacos/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ import (
"dubbo.apache.org/dubbo-go/v3/config"
)

const nacosClientName = "nacos-client"

// NewNacosConfigClientByUrl read the config from url and build an instance
func NewNacosConfigClientByUrl(url *common.URL) (*nacosClient.NacosConfigClient, error) {
sc, cc, err := GetNacosConfig(url)
Expand Down Expand Up @@ -138,5 +136,5 @@ func NewNacosClientByURL(url *common.URL) (*nacosClient.NacosNamingClient, error
return nil, perrors.New("nacos client name must set")
}
logger.Infof("[Nacos Client] New nacos client with config = %+v", scs)
return nacosClient.NewNacosNamingClient(nacosClientName, true, scs, cc)
return nacosClient.NewNacosNamingClient(clientName, true, scs, cc)
}
1 change: 1 addition & 0 deletions remoting/nacos/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func getRegUrl() *common.URL {
// regurlMap.Set(constant.NacosPassword, "nacos")
regurlMap.Set(constant.NacosNamespaceID, "nacos")
regurlMap.Set(constant.TimeoutKey, "5s")
regurlMap.Set(constant.ClientNameKey, "nacos-client")

regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParams(regurlMap))

Expand Down