Sentinel/sentinel-extension/sentinel-datasource-consul
LearningGp eb3a9b099a
Bump version to 1.8.9 (#3566)
* chore: update release configuration

* Bump version to 1.8.9
2025-10-16 20:26:58 +08:00
..
src fix flaky tests and fix passDefaultLocalCheck (#3367) 2024-04-17 10:25:25 +08:00
README.md Update source/target JDK version to 1.8 and update documents 2021-02-04 10:21:40 +08:00
pom.xml Bump version to 1.8.9 (#3566) 2025-10-16 20:26:58 +08:00

README.md

Sentinel DataSource Consul

Sentinel DataSource Consul provides integration with Consul. The data source leverages blocking query (backed by long polling) of Consul.

Usage

To use Sentinel DataSource Consul, you could add the following dependency:

<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-datasource-consul</artifactId>
    <version>x.y.z</version>
</dependency>

Then you can create a ConsulDataSource and register to rule managers. For instance:

ReadableDataSource<String, List<FlowRule>> dataSource = new ConsulDataSource<>(host, port, ruleKey, waitTimeoutInSecond, flowConfigParser);
FlowRuleManager.register2Property(dataSource.getProperty());
  • ruleKey: the rule persistence key
  • waitTimeoutInSecond: long polling timeout (in second) of the Consul API client