seninel部署
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
Eric Zhao fca70646ad Bump version to 1.8.2-SNAPSHOT 3 年前
..
src/main/java/com/alibaba/csp/sentinel/datasource/nacos Optimize logging statements using placeholder (#1736) 4 年前
README.md Refactor Sentinel data source hierarchy 6 年前
pom.xml Bump version to 1.8.2-SNAPSHOT 3 年前

README.md

Sentinel DataSource Nacos

Sentinel DataSource Nacos provides integration with Nacos so that Nacos can be the dynamic rule data source of Sentinel.

To use Sentinel DataSource Nacos, you should add the following dependency:

<dependency>
    <groupId>com.alibaba.csp</groupId>
    <artifactId>sentinel-datasource-nacos</artifactId>
    <version>x.y.z</version>
</dependency>

Then you can create an NacosDataSource and register to rule managers. For instance:

// remoteAddress is the address of Nacos
// groupId and dataId are concepts of Nacos
ReadableDataSource<String, List<FlowRule>> flowRuleDataSource = new NacosDataSource<>(remoteAddress, groupId, dataId,
    source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {}));
FlowRuleManager.register2Property(flowRuleDataSource.getProperty());

We’ve also provided an example: sentinel-demo-nacos-datasource.