seninel部署
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

README.md 1020B

123456789101112131415161718192021222324252627
  1. # Sentinel DataSource Nacos
  2. Sentinel DataSource Nacos provides integration with [Nacos](http://nacos.io) so that Nacos
  3. can be the dynamic rule data source of Sentinel.
  4. To use Sentinel DataSource Nacos, you should add the following dependency:
  5. ```xml
  6. <dependency>
  7. <groupId>com.alibaba.csp</groupId>
  8. <artifactId>sentinel-datasource-nacos</artifactId>
  9. <version>x.y.z</version>
  10. </dependency>
  11. ```
  12. Then you can create an `NacosDataSource` and register to rule managers.
  13. For instance:
  14. ```java
  15. // remoteAddress is the address of Nacos
  16. // groupId and dataId are concepts of Nacos
  17. ReadableDataSource<String, List<FlowRule>> flowRuleDataSource = new NacosDataSource<>(remoteAddress, groupId, dataId,
  18. source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {}));
  19. FlowRuleManager.register2Property(flowRuleDataSource.getProperty());
  20. ```
  21. We've also provided an example: [sentinel-demo-nacos-datasource](https://github.com/alibaba/Sentinel/tree/master/sentinel-demo/sentinel-demo-nacos-datasource).