Spring Boot

Spring Cloud 2020.0.2配置

2021-03-28  本文已影响0人  EasyNetCN
spring:
  application:
    name: goods-service
  config:
    import: consul:${consul.host:localhost}:${consul.port:8500}
  profiles:
    active: development-local
  codec:
    max-in-memory-size:
      -1
  cloud:
    config:
      override-none: true
    consul:
      discovery:
        prefer-ip-address: true
        health-check-critical-timeout: 30s
      config:
        enabled: true
        prefixes:
        - ydyun360-config
        format: yaml
        default-context: ${spring.application.name} 
        watch:
          enabled: false
    loadbalancer:
      ribbon:
        enabled: true
    stream:
      kafka:
        binder:
          auto-add-partitions: false
          auto-create-topics: false
      bindings:
        log-service-topic-output: # 消息订阅通道
          destination: log-service-topic  # topic
          contentType: application/json
          producer:
            partition-key-expression:  headers['partitionKey']
            partition-count: 2
      default-binder: kafka
  cache:
    redis:
      key-prefix: ${spring.application.name}
      time-to-live: 0
  jackson:
    date-format: yyyy-MM-dd HH:mm:ss
    time-zone:
      Asia/Shanghai
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    hikari:
      data-source-properties:
        cachePrepStmts: true
        prepStmtCacheSize: 500
        prepStmtCacheSqlLimit: 2048
        useServerPrepStmts: true
        rewriteBatchedStatements: true
        cacheResultSetMetadata: true
        cacheServerConfiguration: true
        elideSetAutoCommits: true
        maintainTimeStats: false
logging:
  level:
    root: INFO
  file: 
    name: logs/${spring.application.name}.log

server:
  http2:
    enabled: true
  compression:
    enabled: true
    mime-types: application/json,application/xml,text/html,text/javascript,text/css,text/xml,text/plain
    min-response-size: 2048
  port: 8007
上一篇下一篇

猜你喜欢

热点阅读