application.properties

spring.profiles.active=@profileActive@ spring.application.name=@project.artifactId@-@profileActive@# ======================== mybatis ======================== mybatis.mapper-locations[0]=classpath*:com/hehewang/hhw/app/common/mapper/**/*.xml mybatis.mapper-locations[1]=classpath*:com/hehewang/hhw/app/api/mapper/*.xml mybatis.mapper-locations[2]=classpath*:com/hehewang/hhw/app/api/impl/mapper/*.xml mapper.mappers=com.hehewang.hhw.app.common.util.ApiMapper mybatis.configuration.default-enum-type-handler=cn.lyjuan.base.mybatis.typehander.DefaultTypeHandler mapper.enum-as-simple-type=true mapper.not-empty=false mapper.identity=MYSQL # 日志 mybatis.configuration.log-impl=org.apache.ibatis.logging.slf4j.Slf4jImpl pagehelper.helperDialect=mysql pagehelper.reasonable=true pagehelper.supportMethodsArguments=true pagehelper.params=count=countSql# ======================= database ======================= spring.datasource.name=hhw_app spring.datasource.druid.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.type=org.springframework.jdbc.datasource.DriverManagerDataSource #连接池的设置 #初始化时建立物理连接的个数 spring.datasource.druid.initial-size=1 #最小连接池数量 spring.datasource.druid.min-idle=1 #最大连接池数量 maxIdle已经不再使用 spring.datasource.druid.max-active=5 #获取连接时最大等待时间,单位毫秒 spring.datasource.druid.max-wait=5000 #申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 spring.datasource.druid.test-while-idle=true #既作为检测的间隔时间又作为testWhileIdel执行的依据 spring.datasource.druid.time-between-eviction-runs-millis=30000 #销毁线程时检测当前连接的最后活动时间和当前时间差大于该值时,关闭当前连接 spring.datasource.druid.min-evictable-idle-time-millis=180000 #用来检测连接是否有效的sql 必须是一个查询语句 #mysql中为 select 'x' #oracle中为 select 1 from dual spring.datasource.druid.validation-query=select 1 #申请连接时会执行validationQuery检测连接是否有效,开启会降低性能,默认为true spring.datasource.druid.test-on-borrow=false #归还连接时会执行validationQuery检测连接是否有效,开启会降低性能,默认为true spring.datasource.druid.test-on-return=false #当数据库抛出不可恢复的异常时,抛弃该连接 #spring.datasource.druid.exception-sorter=true #是否缓存preparedStatement,mysql5.5+建议开启 spring.datasource.druid.pool-prepared-statements=true #当值大于0时poolPreparedStatements会自动修改为true spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20 #配置扩展插件 spring.datasource.druid.filters=stat,wall,slf4j #通过connectProperties属性来打开mergeSql功能;慢SQL记录 spring.datasource.druid.connection-properties=druid.stat.mergeSql=true; druid.stat.slowSqlMillis=500 #合并多个DruidDataSource的监控数据 spring.datasource.druid.use-global-data-source-stat=true #mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl # WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter spring.datasource.druid.web-stat-filter.enabled=true spring.datasource.druid.web-stat-filter.url-pattern=/* spring.datasource.druid.web-stat-filter.exclusions=*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/* spring.datasource.druid.web-stat-filter.session-stat-enable= spring.datasource.druid.web-stat-filter.session-stat-max-count= spring.datasource.druid.web-stat-filter.principal-session-name= spring.datasource.druid.web-stat-filter.principal-cookie-name= spring.datasource.druid.web-stat-filter.profile-enable= # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置 spring.datasource.druid.stat-view-servlet.enabled=true spring.datasource.druid.stat-view-servlet.url-pattern=/druid/* spring.datasource.druid.stat-view-servlet.reset-enable= spring.datasource.druid.stat-view-servlet.allow= spring.datasource.druid.stat-view-servlet.deny= spring.datasource.druid.filter.stat.merge-sql=true # Spring监控配置,说明请参考Druid Github Wiki,配置_Druid和Spring关联监控配置 # Spring监控AOP切入点,如x.y.z.service.*,配置多个英文逗号分隔 spring.datasource.druid.aop-patterns=com.hehewang.hhw.*# ======================== other ======================== ##404抛异常 spring.mvc.throw-exception-if-no-handler-found=true ##支付宝 alipay.is-cert=true alipay.cert-path=/opt/supervisor/cert/##压测 server.tomcat.threads.max= 50 server.tomcat.max-connections = 10240##encode spring.http2.encoding.charset=UTF-8 spring.http2.encoding.force=true spring.http2.encoding.enabled=true spring.http2.encoding.force-response=true

    推荐阅读