
springcloud
Code神之手
人生辗转,起伏无常。活在当下。
1.01的365次方=37.78343433289>1;
0.99的365次方= 0.02551796445229<1
展开
-
解决警告问题:The Hystrix timeout of 30000ms... the Ribbon read and connect timeout, 240000ms.问题
描述:"message":"The Hystrix timeout of 30000ms for the command macms is set lower than the combination of the Ribbon read and connect timeout, 240000ms.","logger_name":"org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand","th原创 2020-08-20 10:10:34 · 5738 阅读 · 0 评论 -
spring boot和spring cloud 版本映射记录
Release Train Boot Version Greenwich 2.1.x Finchley 2.0.x Edgware 1.5.x Dalston 1.5.x Greenwich构建SpringBoot2.1.x。Finchley构建SpringBoot2.0.x并与其协同工作,而不是使用SpringBo...原创 2020-08-13 19:31:53 · 261 阅读 · 0 评论 -
Feign之@feignclient用法,通过url方式跨Eureka走网关调用服务,以及fallbackFactory熔断机制控制业务
目录背景业务需求Demo实现背景eureka1 中包含一堆服务:aa1aa1vplmvslmaa-gateway(注册ip+端口 :10.10.xx.xx:9901/)等等.............eureka2 中包含一堆服务:bb1bb2bb-gateway(注册ip+端口 :10.10.xx.xx:9902/)customer-imemployee等等.............业务需求vslm 模块需要调用custom..原创 2020-06-29 16:01:02 · 6430 阅读 · 0 评论 -
在使用Spring Cloud多人协作开发时有一个场景下,Eureka客户端注册,多网卡下的IP(虚拟机和本地)选择问题
出现了一个问题:服务成功注册到Eureka,但是该服务接口无法访问。即:在使用Spring Cloud多人协作开发时有一个场景:多台电脑向Eureka注册中心注册服务,注册成功,且服务清单也有显示,但是一直显示的localhost : 端口号,其他人都需要调我本机的开启的服务。(服务端和客户端在不同机器上)。其他人调用我的服务接口,调用失败。查找问题:1、检查是否配置了同一个工作组...原创 2019-11-13 17:24:11 · 1469 阅读 · 0 评论 -
zuul的路由手动配置和默认配置(挺详细的),以及踩到的坑日常记录
服务yml配置:server: port: 8081spring: application: name: item-serviceeureka: client: service-url: defaultZone: http://127.0.0.1:7000/eureka #instance: # ip-address: ${sprin...原创 2019-11-09 23:58:20 · 4822 阅读 · 1 评论 -
微服务Feign伪装访问服务,无需拼接url访问
简单来说就是原来访问服务需要这样两种形式:1、没有用到负载均衡时:url拼接:http+host+port+/user/findAll/{id}然后commRestTemplate.getForObject(url + id, User.class);2、用到负载均衡后:直接通过服务名获取到分配好的host+porturl拼接:http+服务名+/user/find...原创 2019-10-17 02:27:51 · 2241 阅读 · 0 评论 -
微服务Hystrix配置笔记
Hystix是Netflix开源的一个延迟和容错库,用于隔离访问远程服务、第三方库,防止出现级联失败。手段:线程隔离,服务降级通过 fallback method配置配置步骤:服务调用方引入Hystix依赖:<dependency> <groupId>org.springframework.clou...原创 2019-10-17 01:24:42 · 359 阅读 · 0 评论 -
微服务ribbon负载均衡策略和ribbon的重试机制
入口:@SpringBootApplication@EnableDiscoveryClient // 开启Eureka客户端public class CloudConsumerApplication { public static void main(String[] args) { SpringApplication.run(CloudConsum...原创 2019-10-14 14:55:05 · 617 阅读 · 0 评论 -
微服务Ribbon配置报错笔记
Eureka中已经帮我们集成了负载均衡组件:Ribbon因为Eureka中已经集成了Ribbon,所以我们无需引入新的依赖。直接修改代码:在RestTemplate的配置方法上添加@LoadBalanced注解:@SpringBootApplication@EnableDiscoveryClient // 开启Eureka客户端public class...原创 2019-10-14 14:13:19 · 839 阅读 · 0 评论 -
微服务eureka学习之服务提供者,消费者,eureka配置笔记
eureka注册服务:service-url服务发现,拉取服务:服务治理:服务提供方:eureka: client: service-url: # EurekaServer地址 #defaultZone: http://127.0.0.1:8769/eureka,http://127.0.0.1:8770/eureka #map<key,value...原创 2019-10-14 11:10:13 · 468 阅读 · 0 评论 -
springboot之properties,yml配置文件规范及数据映射
配置文件信息会存入spring的apllicationContext容器中,可以用@value和spel表达式获取存:application.properties配置:#端口号#server.port=8081#应用名称 Tomcat started on port(s): 8080 (http) with context path ''server.servl...原创 2019-09-25 04:05:01 · 961 阅读 · 0 评论