-
Notifications
You must be signed in to change notification settings - Fork 929
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
Add: new feature to support dynamic config center which compatible with dubbo 2.6.x & 2.7.x #194
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #194 +/- ##
===========================================
- Coverage 67.49% 65.47% -2.02%
===========================================
Files 94 94
Lines 5864 6303 +439
===========================================
+ Hits 3958 4127 +169
- Misses 1496 1748 +252
- Partials 410 428 +18
Continue to review full report at Codecov.
|
//set configurators to empty | ||
bcl.configurators = []config_center.Configurator{} | ||
return | ||
} else if len(rawConfig) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think u can delete the else as follows,
if rawConfig, err := bcl.dynamicConfiguration.GetConfig(key, config_center.WithGroup(constant.DUBBO)); err != nil {
//set configurators to empty
bcl.configurators = []config_center.Configurator{}
return
}
if len(rawConfig) > 0 {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no else here, I can not access the variable rawConfig produced above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls see it carefully. What I mean is that just 'deleting the else word'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexStocks I means this if I delete else ,then I can not access the variable rawConfig.
return | ||
} | ||
logger.Warnf("getListener() = err:%v", perrors.WithStack(err)) | ||
time.Sleep(time.Duration(RegistryConnDelay) * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need sleep before continue? What we are waiting for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we need a sleep to resubscribe registry when registry subscribe return error instead of subscribing registry in for loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may reduce the CPU percent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hxmhlt Ok.
|
||
listener, err := r.subscribe(url) | ||
if err != nil { | ||
if !r.IsAvailable() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need to check registry alive here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If registry is not alive, we do not need to resubsribe but only return the for loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hxmhlt Ok.
LGTM. |
update readme for |
LGTM |
What this PR does:
1.New feature to support dynamic config center.
2.Service management support service level and application level which compatible with dubbo 2.6.x & 2.7.x, reference from config_center.
3.ZooKeeper as the first dynamic config center implement.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Yes, user can set 'config_center' config in client.yml & server.yml to enable the dynamic config center feature.