odidev 8c4f251922 CI: Polish dependencies for ARM64 and add ARM64 job to Travis CI (#1765) | 4 anni fa | |
---|---|---|
.. | ||
src | 4 anni fa | |
README.md | 5 anni fa | |
pom.xml | 4 anni fa |
Sentinel DataSource Consul provides integration with Consul. The data source leverages blocking query (backed by long polling) of Consul.
NOTE: This module requires JDK 1.8 or later.
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 keywaitTimeoutInSecond
: long polling timeout (in second) of the Consul API client