-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
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.
|
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.
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). |
...source-consul/src/main/java/com/alibaba/csp/sentinel/datasource/consul/ConsulDataSource.java
Outdated
Show resolved
Hide resolved
...source-consul/src/main/java/com/alibaba/csp/sentinel/datasource/consul/ConsulDataSource.java
Outdated
Show resolved
Hide resolved
...source-consul/src/main/java/com/alibaba/csp/sentinel/datasource/consul/ConsulDataSource.java
Show resolved
Hide resolved
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, 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