From 93430938a25ab3d4e218a2198ae1b24a516f6382 Mon Sep 17 00:00:00 2001 From: zhouxiantao <1026371446@qq.com> Date: Tue, 17 Jun 2025 17:31:15 +0800 Subject: [PATCH] freat:粤政易相关代码 --- dyh-gateway/src/main/resources/config/application-prod.yml | 69 ++++++++++++++++++++++++++++++++++ 1 files changed, 69 insertions(+), 0 deletions(-) diff --git a/dyh-gateway/src/main/resources/config/application-prod.yml b/dyh-gateway/src/main/resources/config/application-prod.yml new file mode 100644 index 0000000..58863a7 --- /dev/null +++ b/dyh-gateway/src/main/resources/config/application-prod.yml @@ -0,0 +1,69 @@ +#server配置 +server: + port: 9002 + +#spring配置 +spring: + #服务名 + application: + name: dyh-gateway + datasource: + druid: + stat-view-servlet: + enabled: false + +#注册中心配置 +eureka: + client: + service-url: + #注册中心单机 + defaultZone: http://10.202.1.73:9001/eureka + #注册中心集群 + #defaultZone: http://localhost:8761/eureka,http://localhost:8762/eureka + #是否注册到注册中心 + register-with-eureka: true + #是否从注册中心拉取注册服务列表 + fetch-registry: true + #首次注册时间 + initial-instance-info-replication-interval-seconds: 2 + #客户端定时刷新本地缓存时间 + registry-fetch-interval-seconds: 5 + instance: + prefer-ip-address: true + instance-id: ${spring.cloud.client.ip-address}:${server.port} + # 心跳时间,即服务续约间隔时间(缺省为30s) + lease-renewal-interval-in-seconds: 10 + # 发呆时间,即服务续约到期时间(缺省为90s) + lease-expiration-duration-in-seconds: 30 + +#ribbon配置 +ribbon: + #每台重试次数 + MaxAutoRetries: 2 + #最多重试多少台服务器 + MaxAutoRetriesNextServer: 3 + #serviceId路由时有效 + SocketTimeout: 3000 + #serviceId路由时有效 + ReadTimeout: 60000 + #Ribbon缓存时间 + ServerListRefreshInterval: 2000 + ConnectTimeout: 60000 + +#hystrix 熔断机制 +hystrix: + command: + default: + fallback: + enabled: true # 是否开启降级服务 + circuitBreaker: + enabled: true # 是否开启熔断 + requestCache: + enabled: false # 设置是否缓存请求,request-scope内缓存 + requestLog: + enabled: false # 设置HystrixCommand执行和事件是否打印到HystrixRequestLog中 + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #降级和熔断的超时时间 + -- Gitblit v1.8.0