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

Master sync java enhancement #617

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion clients/naming_client/naming_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ func NewNamingClient(nc nacos_client.INacosClient) (*NamingClient, error) {

naming.serviceProxy, err = NewNamingProxyDelegate(ctx, clientConfig, serverConfig, httpAgent, naming.serviceInfoHolder)

go NewServiceInfoUpdater(ctx, naming.serviceInfoHolder, clientConfig.UpdateThreadNum, naming.serviceProxy).asyncUpdateService()
if clientConfig.AsyncUpdateService {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是准备 默认关闭客户端更新服务实例的逻辑对吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java2.1版本加了开关,默认是打开, 2.2开关默认是关闭的。

后续应该这个逻辑会保留,通过开关打开。

go NewServiceInfoUpdater(ctx, naming.serviceInfoHolder, clientConfig.UpdateThreadNum, naming.serviceProxy).asyncUpdateService()
}
if err != nil {
return naming, err
}
Expand Down
1 change: 1 addition & 0 deletions common/constant/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type ClientConfig struct {
LogSampling *ClientLogSamplingConfig // the sampling config of log
LogRollingConfig *ClientLogRollingConfig // log rolling config
TLSCfg TLSConfig // tls Config
AsyncUpdateService bool // open async update service by query
}

type ClientLogSamplingConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion common/remote/rpc/server_request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (c *NamingPushRequestHandler) RequestReply(request rpc_request.IRequest, _
if ok {
c.ServiceInfoHolder.ProcessService(&notifySubscriberRequest.ServiceInfo)
return &rpc_response.NotifySubscriberResponse{
Response: &rpc_response.Response{ResultCode: constant.RESPONSE_CODE_SUCCESS},
Response: &rpc_response.Response{ResultCode: constant.RESPONSE_CODE_SUCCESS, Success: true},
}
}
return nil
Expand Down