-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Dynamic Rule Configuration
For Chinese version, see 动态规则扩展.
Sentinel's philosophy is that developers only need to pay attention to the definition of resources. Various rules can be dynamically added and updated as soon as the resource is defined. Sentinel provides two ways to modify the rules:
- Direct modification via API (
loadRules
ofXxxRuleManager
) - Integrate with external storage via dynamic
DataSource
Rule management through the API is straightforward. You can modify different rules with the following APIs:
- Flow rule:
FlowRuleManager.loadRules(List<FlowRule> rules)
- Degrade rule:
DegradeRuleManager.loadRules(List<DegradeRule> rules)
- System rule:
SystemRuleManager.loadRules(List<SystemRule> rules)
- Authority rule:
AuthorityRuleManager.loadRules(List<AuthorityRule> rules)
The loadRules()
methods described above only accept rules in memory. But more often the rules are stored in files, databases, or configuration centers. The dynamic DataSource
interface gives us the ability to integrate with any configuration source. It's recommended to use dynamic rule data sources in production.
We recommend you push the rules to the unified rule configuration center after setting the rules through the Sentinel dashboard. Your service (the Sentinel client) implements the ReadableDataSource
interface to observe changes from the configuration center in real-time. The process is as follows:
Currently we support:
-
文档
-
Documents
- Read Me
- Introduction
- How to Use
- How it Works
- Flow Control
- Parameter Flow Control
- Cluster Flow Control
- API Gateway Flow Control
- Circuit Breaking
- Adaptive System Protection
- Metrics
- General Configuration
- Dynamic Rule Configuration
- Dashboard
- Integrations with open-source frameworks
- Contribution Guideline