Spring Cloud 2020.0.2配置

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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容