coupon-user-service-dev.yml 5.4 KB

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