diff --git a/zlt-gateway/zuul-gateway/pom.xml b/zlt-gateway/zuul-gateway/pom.xml
index b73b03d8..bce32be4 100644
--- a/zlt-gateway/zuul-gateway/pom.xml
+++ b/zlt-gateway/zuul-gateway/pom.xml
@@ -32,6 +32,11 @@
com.alibaba.cloud
spring-cloud-starter-alibaba-nacos-discovery
+
+ com.alibaba.cloud
+ spring-cloud-alibaba-sentinel-gateway
+
+
org.springframework.boot
spring-boot-starter-web
diff --git a/zlt-gateway/zuul-gateway/src/main/resources/application.yml b/zlt-gateway/zuul-gateway/src/main/resources/application.yml
index b185e541..04cc572e 100644
--- a/zlt-gateway/zuul-gateway/src/main/resources/application.yml
+++ b/zlt-gateway/zuul-gateway/src/main/resources/application.yml
@@ -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: