seninel部署
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tao.zhang 77932701b6 Add volatile for the stop flag of watcher in ConsulDataSource (#1054) 5 anni fa
..
src Add volatile for the stop flag of watcher in ConsulDataSource (#1054) 5 anni fa
README.md Improve ConsulDataSource and add README.md for the module 5 anni fa
pom.xml Add Consul DataSource integration module (#979) 5 anni fa

README.md

Sentinel DataSource Consul

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.

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