123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- server:
- port: 8091
- netty:
- port: 8808
- bossThread: 1
- logging:
- level:
- root: INFO
- management:
- endpoints:
- web:
- exposure:
- include: "*"
- endpoint:
- shutdown:
- enabled: true
- # 服务名称配置(同时测名称也是注册到eureka中心的名称)
- spring:
- application:
- name: hatech-bcms-core
- zipkin:
- #base-url:当你设置sleuth-cli收集信息后通过http传输到zinkin-server时,需要在这里配置
- base-url: http://10.27.5.129:9411
- enabled: true
- sleuth:
- sampler:
- #收集追踪信息的比率,如果是0.1则表示只记录10%的追踪数据,如果要全部追踪,设置为1(实际场景不推荐,因为会造成不小的性能消耗)
- probability: 1
- # 异常配置 SpringBoot 当出现 404 错误时, 直接抛出异常
- mvc:
- throw-exception-if-no-handler-found: true
- # 数据源配置
- datasource:
- address: 127.0.0.1:3306/chat
- useSSL: false
- druid:
- type: com.alibaba.druid.pool.DruidDataSource
- driver-class-name: com.mysql.cj.jdbc.Driver
- # mysql7连接方式
- url: jdbc:mysql://${spring.datasource.address}?useSSL=${spring.datasource.useSSL}&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT&rewriteBatchedStatements=true
- username: root
- password: 123456
- initialSize: 5
- minIdle: 5
- maxActive: 20
- # 配置获取连接等待超时的时间
- maxWait: 60000
- # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
- timeBetweenEvictionRunsMillis: 60000
- #配置连接在池中的最小生存时间
- minEvictableIdleTimeMillis: 300000
- validationQuery: SELECT '1'
- testWhileIdle: true
- testOnBorrow: false
- testOnReturn: false
- # 打开PSCache,并且指定每个连接上PSCache的大小
- poolPreparedStatements: true
- maxPoolPreparedStatementPerConnectionSize: 20
- # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
- filters: stat,slf4j
- # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
- connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
- sql-script-encoding: utf-8
- # 合并多个DruidDataSource的监控数据
- useGlobalDataSourceStat: true
- # 配置监控界面
- web-stat-filter:
- enabled: true
- url-pattern: /*
- exclusions: /druid/*,*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico
- session-stat-enable: true
- session-stat-max-count: 10
- principal-session-name: session_name
- principal-cookie-name: cookie_name
- stat-view-servlet:
- enabled: true
- url-pattern: /druid/*
- reset-enable: false
- login-username: hatech
- login-password: hatech
- allow: 127.0.0.1,192.168.1.82
- deny: 192.168.1.81
- aop-patterns: cn.com.hatech.bcms.core.*.controller.*.*,cn.com.hatech.bcms.core.*.mapper.*.*,cn.com.hatech.bcms.core.*.service.*.*
- # redis配置
- redis:
- database: 0
- host: 127.0.0.1
- port: 6379
- jedis:
- pool:
- max-active: 20
- # 异常配置 SpringBoot 不要为我们工程中的资源文件建立映射.
- web:
- resources:
- add-mappings: false
- # 文件上传配置
- servlet:
- multipart:
- max-file-size: 50MB
- # 设置单次请求的文件的总大小
- max-request-size: 100MB
- mybatis-plus:
- mapper-locations: classpath*:mapper/**/*.xml
- # 以下配置均有默认值,可以不设置
- global-config:
- db-config:
- #主键类 * AUTO: 数据库ID自增; INPUT: 用户输入ID; ID_WORKER: 全局唯一ID, Long类型的主键; ID_WORKER_STR: 字符串全局唯一ID; UUID: 全局唯一ID,UUID类型的主键; NONE: 该类型为未设置主键类型
- id-type: ASSIGN_ID
- #字段策略 IGNORED:"忽略判断" NOT_NULL:"非 NULL 判断") NOT_EMPTY:"非空判断"
- field-strategy: NOT_EMPTY
- #数据库类型
- db-type: MYSQL
- configuration:
- # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射
- map-underscore-to-camel-case: true
- # 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段
- call-setters-on-nulls: false
- # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
- log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
- # 生产环境开启,不会打印sql执行日志
- #log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
- data-filter: true
- # 异步线程配置
- async:
- executor:
- thread:
- # 配置核心线程数
- core_pool_size: 5
- # 配置最大线程数
- max_pool_size: 10
- # 配置队列大小
- queue_capacity: 50
- # 配置线程池中的线程的名称前缀
- name:
- prefix: async-service-
|