DataSource integration for Consul - #979
Conversation
Codecov Report
@@ Coverage Diff @@
## master #979 +/- ##
============================================
+ Coverage 42.56% 42.77% +0.21%
- Complexity 1441 1450 +9
============================================
Files 310 311 +1
Lines 8984 9047 +63
Branches 1221 1228 +7
============================================
+ Hits 3824 3870 +46
- Misses 4693 4704 +11
- Partials 467 473 +6
Continue to review full report at Codecov.
|
sczyh30
left a comment
There was a problem hiding this comment.
Could you please add a README.md in the module for some instructions? You may refer to: https://github.com/alibaba/Sentinel/blob/master/sentinel-extension/sentinel-datasource-redis/README.md
👌 |
|
And you could describe how the data source works in the PR description (e.g. it leveraged long polling). |
|
Nice, thanks for contributing! |
Thank you for your advice! |
[RIP-9] Update Design_Store.md
Describe what this PR does / why we need it
add consul data source
Does this pull request fix one issue?
#870
Describe how you did it
The data source first initial rules from a Consul during initialization.
Then it start a watcher to observe the updates of rule date and update to memory.
Because Consul do not provide http api to watch the update of KV, so i use a long polling and
blocking queries of the Consul's feature to deal it. When Querying data by index will blocking until change or timeout. If the index of the current query is larger than before, it means that the data has changed.
Describe how to verify it
see UT
Special notes for reviews