码迷,mamicode.com
首页 > 编程语言 > 详细

spring cloud eureka client 写法

时间:2019-07-18 12:11:35      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:style   coding   str   EDA   module   sch   port   cloud   config   

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

 

spring cloud eureka client 写法

标签:style   coding   str   EDA   module   sch   port   cloud   config   

原文地址:https://www.cnblogs.com/whm-blog/p/11206358.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!