seninel部署
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Eric Zhao b212e5f26e Bump version to 0.2.0-SNAPSHOT 6 年之前
..
src/main/java/com/alibaba/csp/sentinel/datasource/nacos Add Nacos datasource integration 6 年之前
README.md Update documents 6 年之前
pom.xml Bump version to 0.2.0-SNAPSHOT 6 年之前

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
DataSource<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.