提交 567d646e 编写于 作者: zlt2000's avatar zlt2000

api网关集成Sentinel网关流控组件

上级 d61d0645
......@@ -32,6 +32,11 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
......
......@@ -2,28 +2,29 @@ spring:
# sentinel动态配置规则
cloud:
sentinel:
zuul:
enabled: true
order:
pre: 2000
post: 500
error: -100
filter:
enabled: false
datasource:
# 限流
ds1:
nacos:
server-addr: ${zlt.nacos.server-addr}
dataId: ${spring.application.name}-sentinel-flow
dataId: ${spring.application.name}-sentinel-gw-flow
groupId: DEFAULT_GROUP
rule-type: flow
# 熔断
rule-type: gw-flow
# api分组
ds2:
nacos:
server-addr: ${zlt.nacos.server-addr}
dataId: ${spring.application.name}-sentinel-degrade
dataId: ${spring.application.name}-sentinel-gw-api-group
groupId: DEFAULT_GROUP
rule-type: degrade
# 系统负载保护
ds4:
nacos:
server-addr: ${zlt.nacos.server-addr}
dataId: ${spring.application.name}-sentinel-system
groupId: DEFAULT_GROUP
rule-type: system
rule-type: gw-api-group
zlt:
oauth2:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册