Support data source integrate with spring cloud config#899
Support data source integrate with spring cloud config#899sczyh30 merged 43 commits intoalibaba:masterfrom linlinisme:spring-config-datasource
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? |
|
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.PropertySourceBootstrapConfigurationand invoke theorg.springframework.cloud.bootstrap.config.PropertySourceLocator#locateto pull configurations from remote server. The spring-cloud-config example isorg.springframework.cloud.config.client.ConfigServicePropertySourceLocatorAll I do it is reference
ConfigServicePropertySourceLocatorbuild 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 supplyrefreshmethod to support dynamic refresh function.Describe how to verify it
In
sentinel-extension/sentinel-datasource-spring-cloud-config/src/testpackage, there is aConfigServerandConfigClient. You should start theConfigServerfirst. It will connected my git warehouse. If you want to use another, modifyconfig-server-application.propertiesfile. Then you can runSentinelRuleLocatorTests. TheConfigClientalso can test function. When you startConfigClient, remember that rename client-bootstrap.yml to bootstrap.yml.Then you can throughSpringCouldDataSourceTestControllerto testSpringCloundConfigDataSource.The page access url is :
localhost:8080/indexSpecial notes for reviews
If this proposal is ok, more test cases and readme file will be provided later