seninel部署
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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