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.

README.md 893B

123456789101112131415161718192021222324252627282930
  1. # Sentinel DataSource Consul
  2. Sentinel DataSource Consul provides integration with Consul. The data source leverages blocking query (backed by
  3. long polling) of Consul.
  4. > **NOTE**: This module requires JDK 1.8 or later.
  5. ## Usage
  6. To use Sentinel DataSource Consul, you could add the following dependency:
  7. ```xml
  8. <dependency>
  9. <groupId>com.alibaba.csp</groupId>
  10. <artifactId>sentinel-datasource-consul</artifactId>
  11. <version>x.y.z</version>
  12. </dependency>
  13. ```
  14. Then you can create a `ConsulDataSource` and register to rule managers.
  15. For instance:
  16. ```java
  17. ReadableDataSource<String, List<FlowRule>> dataSource = new ConsulDataSource<>(host, port, ruleKey, waitTimeoutInSecond, flowConfigParser);
  18. FlowRuleManager.register2Property(dataSource.getProperty());
  19. ```
  20. - `ruleKey`: the rule persistence key
  21. - `waitTimeoutInSecond`: long polling timeout (in second) of the Consul API client