Files
HAOVP/video-gateway/src/main/resources/application-prod.yml
T

109 lines
3.1 KiB
YAML

server:
port: 9000
spring:
application:
name: video-gateway
cloud:
nacos:
discovery:
server-addr: ${NACOS_HOST:nacos}:${NACOS_PORT:8848}
namespace: public
group: DEFAULT_GROUP
# 移除以下健康检查配置
# heart-beat-interval: 5000
# heart-beat-timeout: 15000
register-enabled: true
watch-delay: 30000
watch.enabled: true
loadbalancer:
ribbon:
enabled: false
cache:
enabled: true
caffeine:
spec: initialCapacity=500,expireAfterWrite=5s
# 添加重试机制
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
url-expression: "'lb://'+serviceId"
# 添加重试配置
httpclient:
connect-timeout: 5000
response-timeout: 10000
routes:
# 保持原有路由配置不变,但移除StripPrefix过滤器
- id: video-auth
uri: lb://video-auth
predicates:
- Path=/auth/**
filters:
# 移除 StripPrefix=1 过滤器
- name: Retry
args:
retries: 3
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
methods: GET,POST
backoff:
firstBackoff: 1000ms
maxBackoff: 5000ms
factor: 2
basedOnPreviousValue: false
- id: video-user
uri: lb://video-user
predicates:
- Path=/user/**
filters:
# 移除 StripPrefix=1 过滤器
- name: Retry
args:
retries: 3
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
methods: GET,POST
- id: video-content
uri: lb://video-content
predicates:
- Path=/content/**
filters:
# 移除 StripPrefix=1 过滤器
- name: Retry
args:
retries: 3
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
methods: GET,POST
- id: video-comment
uri: lb://video-comment
predicates:
- Path=/comment/**
filters:
# 移除 StripPrefix=1 过滤器
- name: Retry
args:
retries: 3
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
methods: GET,POST
- id: video-admin
uri: lb://video-admin
predicates:
- Path=/admin/**
filters:
# 移除 StripPrefix=1 过滤器
- name: Retry
args:
retries: 3
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
methods: GET,POST
- id: video-recommend
uri: lb://video-recommend
predicates:
- Path=/recommend/**
filters:
# 移除 StripPrefix=1 过滤器
- name: Retry
args:
retries: 3
statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
methods: GET,POST