application.yml
2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
server:
port: 9999
spring:
application:
name: jeecg-gateway
main:
allow-circular-references: true
config:
import:
- optional:nacos:${spring.application.name}-@profile.name@.yaml
cloud:
nacos:
config:
server-addr: @config.server-addr@
discovery:
server-addr: ${spring.cloud.nacos.config.server-addr}
gateway:
discovery:
locator:
enabled: true
globalcors:
cors-configurations:
'[/**]':
allowCredentials: true
#springboot2.4后需用allowedOriginPatterns
allowedOriginPatterns: "*"
allowedMethods: "*"
allowedHeaders: "*"
#Sentinel配置
sentinel:
transport:
dashboard: jeecg-boot-sentinel:9000
# 支持链路限流
web-context-unify: false
filter:
enabled: false
# 取消Sentinel控制台懒加载
eager: false
datasource:
#流控规则
flow: # 指定数据源名称
# 指定nacos数据源
nacos:
server-addr: @config.server-addr@
# 指定配置文件
dataId: ${spring.application.name}-flow-rules
# 指定分组
groupId: SENTINEL_GROUP
# 指定配置文件规则类型
rule-type: flow
# 指定配置文件数据格式
data-type: json
#降级规则
degrade:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-degrade-rules
groupId: SENTINEL_GROUP
rule-type: degrade
data-type: json
#系统规则
system:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-system-rules
groupId: SENTINEL_GROUP
rule-type: system
data-type: json
#授权规则
authority:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-authority-rules
groupId: SENTINEL_GROUP
rule-type: authority
data-type: json
#热点参数
param-flow:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-param-rules
groupId: SENTINEL_GROUP
rule-type: param-flow
data-type: json
#网关流控规则
gw-flow:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-flow-rules
groupId: SENTINEL_GROUP
rule-type: gw-flow
data-type: json
#API流控规则
gw-api-group:
nacos:
server-addr: @config.server-addr@
dataId: ${spring.application.name}-api-rules
groupId: SENTINEL_GROUP
rule-type: gw-api-group
data-type: json