seninel部署
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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