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
  • 相关阅读:
    ListComparer
    C#.net中类与结构的区别
    对C# 中堆栈,堆,值类型,引用类型的理解
    一道面试题
    Mvc不等于三层架构
    SQL养成一个好习惯是一笔财富
    清除MSSQL事务日志文件
    面向对象设计(OOD)五大基本原则
    .net/c#中栈和堆的区别及代码在栈和堆中的执行流程详解之一
    IIS7 Login failed for user IIS APPPOOL\ASP.NET v4.0
  • 原文地址:https://www.cnblogs.com/whm-blog/p/11206358.html
Copyright © 2011-2022 走看看