-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Support data source integrate with spring cloud config #899
Conversation
using the LongAdder rather than AtomicInteger to Provides better performance
merge master
…perties directory
merge online
…cator to load log config
merge onlie
merge online
This reverts commit d401c2f
Codecov Report
@@ Coverage Diff @@
## master #899 +/- ##
============================================
- Coverage 42.74% 42.48% -0.27%
- Complexity 1450 1458 +8
============================================
Files 311 315 +4
Lines 9047 9223 +176
Branches 1228 1258 +30
============================================
+ Hits 3867 3918 +51
- Misses 4706 4814 +108
- Partials 474 491 +17
Continue to review full report at Codecov.
|
Would you like to provide some suggestions on this? @fangjian0423 |
hi, is there some progress? |
I've reviewed the code last week, and I'll need to test the sample these days :) |
Nice work. I'm wondering how this could achieve dynamic updating? It seems when the content of |
They dynamic updating function is based on the Web Hook call back. When you change config in the Server does you setting Web Hook call back url ? I offer a test in |
listener had added |
How could the client perceive that the remote config has changed? By binding a git webhook with the |
Yes, it is. |
some process? |
Could you please add a brief instruction for this in the document? |
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.
LGTM
Nice work. Thanks for contributing! |
[RIP-10] Add test case for QueryCorrectionOffsetBody & ResetOffsetBody
###Describe what this PR does / why we need it
Now, data source support nacos,zeepkeeper,redis and so on.The spring-cloud-config also should be.
Does this pull request fix one issue?
Fix issue: #831
Describe how you did it
My proposal is based on spring cloud config original loading mechanism.
The PropertySourceLocator Interface : provides external attribute loading extension points.
Any class implements PropertySourceLocator interface and modified with corresponding annotation.
It will be loaded by
org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration
and invoke theorg.springframework.cloud.bootstrap.config.PropertySourceLocator#locate
to pull configurations from remote server. The spring-cloud-config example isorg.springframework.cloud.config.client.ConfigServicePropertySourceLocator
All I do it is reference
ConfigServicePropertySourceLocator
build another client which can integrate with sentinel data source and support dynamic refresh.It's name is
com.alibaba.csp.sentinel.datasource.spring.cloud.config.SentinelRuleLocator
. It will be created when spring application start and pull configurations. It supplyrefresh
method to support dynamic refresh function.Describe how to verify it
In
sentinel-extension/sentinel-datasource-spring-cloud-config/src/test
package, there is aConfigServer
andConfigClient
. You should start theConfigServer
first. It will connected my git warehouse. If you want to use another, modifyconfig-server-application.properties
file. Then you can runSentinelRuleLocatorTests
. TheConfigClient
also can test function. When you startConfigClient
, remember that rename client-bootstrap.yml to bootstrap.yml.Then you can throughSpringCouldDataSourceTestController
to testSpringCloundConfigDataSource
.The page access url is :
localhost:8080/index
Special notes for reviews
If this proposal is ok, more test cases and readme file will be provided later