1. springboot-lll-starter限流说明1.1. 配置 限流在order模块的bootstrap.yml配置中,主要为如下配置 spring: cloud: sentinel: eager: false transport: dashboard: localhost:8080 datasource: ds: nacos: server-addr: localhost:8848 dataId: ${spring.application.name}-sentinel ruleType: flow groupId: DEFAULT_GROUP# ds1:# file:# file: classpath:flowrule.json# rule-type: flow# data-type: json写了两种方式,读文件和读nacos配置 1.2. json限流配置文件内容 [ { "resource":"user_list", "limitApp":"default", "grade":1, "count":1, "strategy":0, "controlBehavior":0, "clusterMode":"false" }]- resource:资源名称;
- limitApp:来源应用(默认)
- grade:阈值类型;0:线程数;1:表示QPS
- strategy:流控模式,0:直接;1:关联;2:链路
- controlBehavior:流控的结果;0:快速失败;1:Warm up;2:排队等待
- clusterMode:是否集群
1.3. 效果以上内容转载自网络 更多讯息欢迎添加小优:DKA-2018
|