123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- server:
- port: 20003
- spring:
- application:
- name: sikey-websocket-business
- profiles:
- active: "test"
- main:
- allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
- allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
- # web-application-type: reactive
- #config:
- #import: "consul:"
- # Jackson 配置项
- jackson:
- serialization:
- write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
- write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
- write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
- fail-on-empty-beans: false # 允许序列化无属性的 Bean
- # Consul 集成配置
- cloud:
- consul:
- host: 106.75.230.4
- #host: 127.0.0.1
- port: 8500
- # discovery
- discovery:
- enabled: true
- prefer-ip-address: true
- instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port}
- # config
- config:
- enabled: false
- format: YAML
- data-key: data
- # MyBatis Plus 的配置项
- mybatis-plus:
- configuration:
- map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
- global-config:
- db-config:
- id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
- # id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
- # id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
- # id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
- logic-delete-value: 1 # 逻辑已删除值(默认为 1)
- logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
- banner: false # 关闭控制台的 Banner 打印
- type-aliases-package: ${sikey.info.base-package}.dal.dataobject
- --- #################### 数据库相关配置 ####################
- spring:
- # 数据源配置项
- autoconfigure:
- exclude:
- datasource:
- druid: # Druid 【监控】相关的全局配置
- web-stat-filter:
- enabled: true
- stat-view-servlet:
- enabled: true
- allow: # 设置白名单,不填则允许所有访问
- url-pattern: /druid/*
- login-username: # 控制台管理用户名和密码
- login-password:
- filter:
- stat:
- enabled: true
- log-slow-sql: true # 慢 SQL 记录
- slow-sql-millis: 100
- merge-sql: true
- wall:
- config:
- multi-statement-allow: true
- dynamic: # 多数据源配置
- druid: # Druid 【连接池】相关的全局配置
- initial-size: 5 # 初始连接数
- min-idle: 10 # 最小连接池数量
- max-active: 20 # 最大连接池数量
- max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
- time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
- min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
- max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
- validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
- test-while-idle: true
- test-on-borrow: true
- test-on-return: true
- primary: master
- datasource:
- master:
- 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 连接的示例
- #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
- username: root
- password: 9RKdJsEQKnjrni9R
- #password: 1qaz@WSX
- slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
- lazy: true # 开启懒加载,保证启动速度
- 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 连接的示例
- #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
- username: root
- password: 9RKdJsEQKnjrni9R
- #password: 1qaz@WSX
- ---
- # Spring Data Redis 配置
- spring:
- data:
- redis:
- repositories:
- enabled: true
- host: 106.75.230.4
- port: 6379
- password: sikey!Q@W#E456
- timeout: 5000
- ---
- # rabbitmq 配置
- spring:
- rabbitmq:
- host: 106.75.230.4
- port: 5672
- username: wa04
- password: wa04@skey123
- # 连接池配置
- cache:
- connection:
- mode: CONNECTION # 复用连接池
- size: 10 # 最大活跃连接数
- channel:
- size: 100 # 单连接通道缓存数
- checkout-timeout: 10000 # 获取通道超时时间(毫秒)
- virtual-host: /
- connection-timeout: 5000
- requested-heartbeat: 60
- publisher-confirm-type: correlated
- messaging:
- queue-name: publish_mcdisk_queue
- exchange-name: mcdisk_exchange.topic
- routing-key: publish.#
- # 重试机制
- listener:
- simple:
- retry:
- enabled: true
- max-attempts: 3
- initial-interval: 1000
- max-interval: 10000
- multiplier: 2
- sikey:
- info:
- version: 1.0.0
- base-package: cn.sikey.websocket
|