zoukankan      html  css  js  c++  java
  • spring cloud eureka client 写法

    spring:
      application:
        name: ${app:unicom-statistic}
    
      cloud:
        config:
          uri: http://${config-ip:192.168.0.110}:8500
          profile: ${profile:dev}
          label: master
      task:
        scheduling:
          pool:
            size: 5
      # 数据源
      datasource:
        username: ${db.username}
        password: ${db.password}
        type: com.zaxxer.hikari.HikariDataSource
        driver-class-name: com.mysql.cj.jdbc.NonRegisteringDriver
        url: jdbc:mysql://${db.host}/${db.name}?useSSL=false&serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8
        hikari:
          minimum-idle: 1
          maximum-pool-size: 3
        tomcat:
          min-idle: 1
          max-active: 3
    mybatis:
      mapper-locations: classpath*:cloud/cjy/travel/module/**/permenentPeopleDao/*.xml,classpath*:cloud/cjy/travel/**/permenentPeopleDao/*.xml,classpath*:cloud/cjy/travel/module/common/**/permenentPeopleDao/*.xml
    
    
    # eureka 配置
    eureka:
      instance:
        # 一个 项目部署多个时, appname 应该一致, instance-id 不一致
        appname: unicom-statistic  
        # instance-id: ${spring.cloud.client.ip-address}:${server.port} 
        instance-id: ${spring.application.name}-${spring.cloud.client.ip-address}
      client:
        fetch-registry: true
        service-url:
          defaultZone: http://${eureka-server.user}:${eureka-server.password}@${eureka-server.host}/eureka/
    
    # feign 超时 配置,不可修改
    feign-timeout: 1800000 # 半小时
    feign:
      client:
        default:
          #这里时间一定要调长,否则feign客户端会报ReadTimeOut  服务端报Error parsing HTTP request header
          connectTimeout: 60000
          readTimeout: ${feign-timeout}
          loggerLevel: basic
      httpclient:
        connection-timeout: 60000
    ribbon:
      ReadTimeout: ${feign-timeout}
      ConnectTimeout: 60000
  • 相关阅读:
    Django视图
    Django路由系统
    Django概述,配置文件,web框架本质,Django框架
    Mysql
    R语言之常用函数
    从PCA、PLS-DA、OPLS-DA学习线性代数和矩阵
    算法第一关
    别人处理二代测序的流程
    reportlab包使用指南
    Python 文本(txt) 转换成 EXCEL(xls)
  • 原文地址:https://www.cnblogs.com/whm-blog/p/11206358.html
Copyright © 2011-2022 走看看