广州市综治平台后端
xusd
9 days ago 0036fe63364fb92ffc0255e38f38a3af5c6b7f6b
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
#server配置
server:
  port: 9002
 
#spring配置
spring:
  #服务名
  application:
    name: dyh-gateway
  datasource:
    druid:
      stat-view-servlet:
        enabled: false
 
#注册中心配置
eureka:
  client:
    service-url:
      #注册中心单机
      defaultZone: http://localhost: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 #降级和熔断的超时时间