coupon-user-service-dev.yml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. server:
  2. port: 20002
  3. # servlet:
  4. # context-path: /coupon-user
  5. spring:
  6. rabbitmq:
  7. host: 192.168.110.175
  8. port: 5672
  9. username: guest
  10. password: guest
  11. application:
  12. name: coupon-user-service
  13. jpa:
  14. show-sql: true
  15. hibernate:
  16. ddl-auto: none
  17. properties:
  18. hibernate.format_sql: true
  19. hibernate.show_sql: true
  20. open-in-view: false
  21. datasource:
  22. # 数据源
  23. url: jdbc:mysql://127.0.0.1:3306/broadview_coupon_db?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true&zeroDateTimeBehavior=convertToNull&serverTimezone=UTC
  24. username: root
  25. password: 123456
  26. type: com.zaxxer.hikari.HikariDataSource
  27. driver-class-name: com.mysql.cj.jdbc.Driver
  28. # 连接池
  29. hikari:
  30. connection-timeout: 20000
  31. idle-timeout: 20000
  32. maximum-pool-size: 20
  33. minimum-idle: 5
  34. max-lifetime: 30000
  35. auto-commit: true
  36. pool-name: BroadviewCouponHikari
  37. # redis:
  38. # database: 0
  39. # host: 127.0.0.1
  40. # port: 6379
  41. # # password:
  42. # # 连接超时时间
  43. # timeout: 10000
  44. # kafka:
  45. # bootstrap-servers:
  46. # - localhost:9092
  47. # consumer:
  48. # group-id: broadview-test
  49. # auto-offset-reset: latest
  50. #eureka:
  51. # client:
  52. # service-url:
  53. # defaultZone: http://localhost:10000/eureka/
  54. # Ribbon全局配置
  55. # 如果配置了Feign接口超时,那么ribbon超时配置则不生效
  56. ribbon:
  57. ConnectTimeout: 1000 #服务请求连接超时时间(毫秒)
  58. ReadTimeout: 1000 #服务请求处理超时时间(毫秒)
  59. OkToRetryOnAllOperations: true #对超时请求启用重试机制
  60. MaxAutoRetriesNextServer: 2 #切换重试实例的最大个数
  61. MaxAutoRetries: 1 # 切换实例后重试最大次数
  62. # 发送到coupon-template-service服务的负载均衡配置
  63. # 如果配置了Feign接口超时,那么ribbon超时配置则不生效
  64. coupon-template-service:
  65. ribbon:
  66. # 指定负载均衡策略为随机访问策略
  67. # 一般采用默认的RoundRobin负载均衡策略
  68. NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RandomRule
  69. # 指定IPing策略(一般策略中不指定IPing),配合Feign使用
  70. NFLoadBalancerPingClassName: com.netflix.niws.loadbalancer.NIWSDiscoveryPing
  71. ConnectTimeout: 1000 #服务请求连接超时时间(毫秒)
  72. ReadTimeout: 1000 #服务请求处理超时时间(毫秒)
  73. OkToRetryOnAllOperations: true #对超时请求启用重试机制
  74. MaxAutoRetriesNextServer: 1 #切换重试实例的最大个数
  75. MaxAutoRetries: 1 # 切换实例后重试最大次数
  76. # 将TemplateClient类的日志级别设置为debug
  77. logging:
  78. level:
  79. com.broadview.coupon.user.external.TemplateClient: debug
  80. # feign 配置
  81. feign:
  82. hystrix:
  83. enabled: true
  84. compression:
  85. request:
  86. enabled: true
  87. mime-types: text/xml,application/xml,application/json
  88. min-request-size: 1024
  89. response:
  90. enabled: true
  91. client:
  92. config:
  93. default: # 全局生效
  94. connectTimeout: 1000 # 默认的连接超时时间是 10s
  95. readTimeout: 5000
  96. coupon-template-service: # 单独服务的配置
  97. connectTimeout: 1000 # 默认的连接超时时间是 10s
  98. readTimeout: 5000
  99. hystrix:
  100. metrics:
  101. enabled: true
  102. command:
  103. # 此处添加HystrixCommand中配置的commandKey
  104. # requestCouponKey:
  105. # execution:
  106. # isolation:
  107. # thread:
  108. # #requestCoupon的超时时间
  109. # timeoutInMilliseconds: 2000
  110. default:
  111. fallback:
  112. enabled: true # 开启降级(默认处于开启状态)
  113. circuitBreaker:
  114. enabled: true #开启/禁用熔断机制(默认开启)
  115. requestVolumeThreshold: 4 # 断路器请求阈值
  116. sleepWindowInMilliseconds: 10000 # 断路器等待窗口
  117. errorThresholdPercentage: 50 # 断路器错误百分比(触发条件)
  118. metrics:
  119. rollingStats:
  120. timeInMilliseconds: 20000 #滑动窗口持续时间
  121. # numBuckets: 10 #滑动窗口中bucket数量
  122. # rollingPercentile:
  123. # enabled: true #是否执行时间百分比信息
  124. # timeInMilliseconds: 60000 #执行时间统计周期
  125. # numBuckets: 6 #执行时间统计内的bucket数量
  126. # bucketSize: 1000 #每个bucket最多统计的记录条数
  127. # healthSnapshot:
  128. # intervalInMilliseconds: 500 #健康快照信息采集间隔
  129. execution:
  130. timeout:
  131. #是否允许超时
  132. enabled: true
  133. isolation:
  134. thread:
  135. timeoutInMilliseconds: 3000 # 全局超时时间
  136. interruptOnTimeout: true # 超时后是否中断线程
  137. interruptOnCancel: true # 取消调用后是否中断线程
  138. semaphore:
  139. maxConcurrentRequests: 10 #最大并发请求数
  140. #management:
  141. # endpoint:
  142. # health:
  143. # # 总是显示各个组件的actuator信息
  144. # show-details: always
  145. # endpoints:
  146. # web:
  147. # exposure:
  148. # # 暴露所有endpoint
  149. # include: '*'
  150. # security:
  151. # enabled: false