Use OpenSergo with Sentinel
Sentinel is a cloud-native traffic governance component that takes "flow" as the breakthrough point and covers multiple fields including rate limiting, concurrency limiting, circuit breaking, and adaptive overload protection to guarantee the reliability of microservices.
Sentinel provides data-source module sentinel-datasource-opensergo
, which provides integration with OpenSergo spec.
Usage
To use Sentinel OpenSergo data-source, you'll need to add the following Maven dependency:
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-datasource-opensergo</artifactId>
<!-- For Sentinel 1.8.6 -->
<version>0.1.0-beta</version>
</dependency>
Then you can create an OpenSergoDataSourceGroup
and subscribe Sentinel rules. For example:
OpenSergoDataSourceGroup openSergo = new OpenSergoDataSourceGroup(host, port, namespace, appName);
openSergo.start();
// Subscribe flow rules from OpenSergo control plane, and propagate to Sentinel rule manager.
FlowRuleManager.register2Property(openSergo.subscribeFlowRules());