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 841B

12345678910111213141516171819202122232425262728
  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. ## Usage
  5. To use Sentinel DataSource Consul, you could add the following dependency:
  6. ```xml
  7. <dependency>
  8. <groupId>com.alibaba.csp</groupId>
  9. <artifactId>sentinel-datasource-consul</artifactId>
  10. <version>x.y.z</version>
  11. </dependency>
  12. ```
  13. Then you can create a `ConsulDataSource` and register to rule managers.
  14. For instance:
  15. ```java
  16. ReadableDataSource<String, List<FlowRule>> dataSource = new ConsulDataSource<>(host, port, ruleKey, waitTimeoutInSecond, flowConfigParser);
  17. FlowRuleManager.register2Property(dataSource.getProperty());
  18. ```
  19. - `ruleKey`: the rule persistence key
  20. - `waitTimeoutInSecond`: long polling timeout (in second) of the Consul API client