Created
June 28, 2021 14:00
-
-
Save rubykv/93239f50ef003bed1a425c3eeaf37885 to your computer and use it in GitHub Desktop.
Sentinel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class TestConfiguration { | |
@Bean | |
public SentinelResourceAspect sentinelResourceAspect() { | |
return new SentinelResourceAspect(); | |
} | |
@PostConstruct | |
public void init() { | |
setFlowRules(); | |
} | |
private void setFlowRules() { | |
List<FlowRule> flowRules = new ArrayList<>(); | |
FlowRule flowRule = new FlowRule(); | |
flowRule.setGrade(RuleConstant.FLOW_GRADE_QPS); | |
flowRule.setCount(1); | |
flowRules.add(flowRule); | |
FlowRuleManager.loadRules(flowRules); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment