美文网首页Spring Boot
Spring Cloud 2020.0.2配置

Spring Cloud 2020.0.2配置

作者: EasyNetCN | 来源:发表于2021-03-28 06:54 被阅读0次
    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
    

    相关文章

      网友评论

        本文标题:Spring Cloud 2020.0.2配置

        本文链接:https://www.haomeiwen.com/subject/xvnuhltx.html