application.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. server:
  2. port: 20003
  3. spring:
  4. application:
  5. name: sikey-websocket-business
  6. profiles:
  7. active: "test"
  8. main:
  9. allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
  10. allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
  11. # web-application-type: reactive
  12. #config:
  13. #import: "consul:"
  14. # Jackson 配置项
  15. jackson:
  16. serialization:
  17. write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
  18. write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
  19. write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
  20. fail-on-empty-beans: false # 允许序列化无属性的 Bean
  21. # Consul 集成配置
  22. cloud:
  23. consul:
  24. host: 106.75.230.4
  25. #host: 127.0.0.1
  26. port: 8500
  27. # discovery
  28. discovery:
  29. enabled: true
  30. prefer-ip-address: true
  31. instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port}
  32. # config
  33. config:
  34. enabled: false
  35. format: YAML
  36. data-key: data
  37. # MyBatis Plus 的配置项
  38. mybatis-plus:
  39. configuration:
  40. map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
  41. global-config:
  42. db-config:
  43. id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
  44. # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
  45. # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
  46. # id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
  47. logic-delete-value: 1 # 逻辑已删除值(默认为 1)
  48. logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
  49. banner: false # 关闭控制台的 Banner 打印
  50. type-aliases-package: ${sikey.info.base-package}.dal.dataobject
  51. --- #################### 数据库相关配置 ####################
  52. spring:
  53. # 数据源配置项
  54. autoconfigure:
  55. exclude:
  56. datasource:
  57. druid: # Druid 【监控】相关的全局配置
  58. web-stat-filter:
  59. enabled: true
  60. stat-view-servlet:
  61. enabled: true
  62. allow: # 设置白名单,不填则允许所有访问
  63. url-pattern: /druid/*
  64. login-username: # 控制台管理用户名和密码
  65. login-password:
  66. filter:
  67. stat:
  68. enabled: true
  69. log-slow-sql: true # 慢 SQL 记录
  70. slow-sql-millis: 100
  71. merge-sql: true
  72. wall:
  73. config:
  74. multi-statement-allow: true
  75. dynamic: # 多数据源配置
  76. druid: # Druid 【连接池】相关的全局配置
  77. initial-size: 5 # 初始连接数
  78. min-idle: 10 # 最小连接池数量
  79. max-active: 20 # 最大连接池数量
  80. max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
  81. time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
  82. min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
  83. max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
  84. validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
  85. test-while-idle: true
  86. test-on-borrow: true
  87. test-on-return: true
  88. primary: master
  89. datasource:
  90. master:
  91. url: jdbc:mysql://106.75.230.4:13306/mc_disk?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=10 # MySQL Connector/J 8.X 连接的示例
  92. #url: jdbc:mysql://127.0.0.1:3306/mc_disk?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
  93. username: root
  94. password: 9RKdJsEQKnjrni9R
  95. #password: 1qaz@WSX
  96. slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
  97. lazy: true # 开启懒加载,保证启动速度
  98. url: jdbc:mysql://106.75.230.4:13306/mc_disk?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=10 # MySQL Connector/J 8.X 连接的示例
  99. #url: jdbc:mysql://127.0.0.1:3306/mc_disk?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
  100. username: root
  101. password: 9RKdJsEQKnjrni9R
  102. #password: 1qaz@WSX
  103. ---
  104. # Spring Data Redis 配置
  105. spring:
  106. data:
  107. redis:
  108. repositories:
  109. enabled: true
  110. host: 106.75.230.4
  111. port: 6379
  112. password: sikey!Q@W#E456
  113. timeout: 5000
  114. ---
  115. # rabbitmq 配置
  116. spring:
  117. rabbitmq:
  118. host: 106.75.230.4
  119. port: 5672
  120. username: wa04
  121. password: wa04@skey123
  122. # 连接池配置
  123. cache:
  124. connection:
  125. mode: CONNECTION # 复用连接池
  126. size: 10 # 最大活跃连接数
  127. channel:
  128. size: 100 # 单连接通道缓存数
  129. checkout-timeout: 10000 # 获取通道超时时间(毫秒)
  130. virtual-host: /
  131. connection-timeout: 5000
  132. requested-heartbeat: 60
  133. publisher-confirm-type: correlated
  134. messaging:
  135. queue-name: publish_mcdisk_queue
  136. exchange-name: mcdisk_exchange.topic
  137. routing-key: publish.#
  138. # 重试机制
  139. listener:
  140. simple:
  141. retry:
  142. enabled: true
  143. max-attempts: 3
  144. initial-interval: 1000
  145. max-interval: 10000
  146. multiplier: 2
  147. sikey:
  148. info:
  149. version: 1.0.0
  150. base-package: cn.sikey.websocket