server:
  #开启优雅停机
  shutdown: graceful
  port: 8086
  servlet:
    context-path: /task
  tomcat:
    uri-encoding: UTF-8
    threads:
      max: 800
      min-spare: 100
spring:
  servlet:
    multipart:
      # 修改上传文件临时路径为 /data1/tmp
      location: /data1/tmp
      max-file-size: 100MB
      max-request-size: 100MB
  application:
    name: @artifactId@
    # 如果需要使用读写分离, 此处需要改造, 有没有办法不用改?
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: ${config.jdbc.master.task.username}
    password: ${config.jdbc.master.task.password}
    url: jdbc:mysql://${config.jdbc.master.task.host}:${config.jdbc.master.task.port}/${config.jdbc.master.task.database}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
    hikari:
      # 最大线程池数量
      maximum-pool-size: 30
      # 最小线程池数量
      minimum-idle: 5
      # 检测连接
      connection-test-query: SELECT 1
      # 连接超时时间 默认30分钟
      connection-timeout: 30000
      # 连接最大生存期间, 默认30分钟
      #max-lifetime: 300000
  devtools:
    restart:
      enabled: true
  jackson:
    default-property-inclusion: ALWAYS
    time-zone: GMT+8
    date-format: yyyy-MM-dd HH:mm:ss
# mybaits-plus配置
mybatis-plus:
  # 全局刷新 mapper
  mapper-locations: classpath:/mapper/**/*.xml
  global-config:
    refresh:
      enable: true
    db-config:
      id-type: auto
      table-underline: true
      logic-delete-value: 1
      logic-not-delete-value: 0
  configuration:
    map-underscore-to-camel-case: true
    cache-enabled: false
    call-setters-on-nulls: true
    jdbc-type-for-null: 'null'
    default-enum-type-handler: com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# feign 配置
feign:
  sentinel:
    enabled: true
  okhttp:
    enabled: true
  httpclient:
    enabled: false
  client:
    config:
      default:
        connectTimeout: 10000
        readTimeout: 10000
  compression:
    request:
      enabled: true
    response:
      enabled: true
# 暴露监控端点
management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS

# 日志监听配置 -- 如果启用的话，需要配置 kafka 的路径
logging:
  config: classpath:logback-nacos.xml
rocketmq:
  name-server: ${config.rocketmq.name-server}
  producer:
    # 生产者分组
    group: ${config.rocketmq.producer.group}
    # 发送消息超时时间, 单位毫秒, 默认3000
    send-message-timeout: 10000
    # 消息压缩阈值, 当消息体的大小超过该阈值时进行消息压缩,默认为4*1024B
    compress-message-body-threshold: 4096
    # 消息体的最大允许大小,默认为4*1024*1024B
    max-message-size: 4194304
    # 同步发送消息时,失败重试次数,默认2
    retry-times-when-send-failed: 2
    # 异步发送消息时,失败重试次数,默认2
    retry-times-when-send-async-failed: 2
    # 发送消息给broker 时,发送失败是否重试另一台broker, 默认为false
    retry-next-server: false
    access-key: # Access Key ，可阅读 https://github.com/apache/rocketmq/blob/master/docs/cn/acl/user_guide.md 文档
    secret-key: # Secret Key
    # 是否开启消息轨迹功能,默认为false 可阅读 https://github.com/apache/rocketmq/blob/master/docs/cn/msg_trace/user_guide.md 文档
    enable-msg-trace: false
    # 自定义消息轨迹的 Topic 。默认为 RMQ_SYS_TRACE_TOPIC 。
    customized-trace-topic: RMQ_SYS_TRACE_TOPIC
  consumer:
    # 配置某个消费分组，是否监听指定 Topic 。结构为 Map<消费者分组, <Topic, Boolean>> 。默认情况下，不配置表示监听。
    listeners:
      # 关闭 test-consumer-group 对 topic1 的监听消费
      test-consumer-group:
        topic1: false # 关闭 test-consumer-group 对 topic1 的监听消费


