功能添加,项目地址
限流在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配置
http://www.imooc.com/article/details/id/289464
限流配置文件内容
[
{
"resource":"user_list",
"limitApp":"default",
"grade":1,
"count":1,
"strategy":0,
"controlBehavior":0,
"clusterMode":"false"
}
]