上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: 1:方法的熔断 /** * 服务熔断 * * @return */ @HystrixCommand(fallbackMethod = "numLessZeroException", commandProperties = { //ctrl+shift+A 查询HystrixCommandProper 阅读全文
posted @ 2020-04-26 22:14 Draymond 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1:pom <!-- hystrix --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> </depen 阅读全文
posted @ 2020-04-21 21:13 Draymond 阅读(390) 评论(0) 推荐(0) 编辑
摘要: pom <!-- hystrix--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> </dependen 阅读全文
posted @ 2020-04-21 20:55 Draymond 阅读(599) 评论(0) 推荐(0) 编辑
摘要: yml配置 #自定义ribbon的超时时间 ribbon: ReadTimeout: 5000 #处理请求的超时时间,默认为5秒 ConnectTimeout: 5000 #连接建立的超时时长,默认5秒 MaxAutoRetries: 1 #同一台实例的最大重试次数,但是不包括首次调用,默认为1次 阅读全文
posted @ 2020-04-18 20:09 Draymond 阅读(4717) 评论(0) 推荐(1) 编辑
摘要: ribbon的使用方式 ribbon调用服务方式 ribbon+restTemplete openFeign的调用服务方式 controller层直接调用service openFeign是对ribbon做了进一步的封装 阅读全文
posted @ 2020-04-18 16:22 Draymond 阅读(1610) 评论(0) 推荐(2) 编辑
摘要: 作用 类似ribbon提供客户端的负载均衡 1:pom <! eureka-client --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eu 阅读全文
posted @ 2020-04-18 16:13 Draymond 阅读(1150) 评论(0) 推荐(0) 编辑
摘要: 作用 客户端的负载均衡,与RestTemplate结合使用 1:pom eureka的客户端与nocos的客户端pom依赖,都集成了ribbon,所以不再需要重复添加依赖 2:将RestTemplate注入到spring容i中 @Component @Configuration public cla 阅读全文
posted @ 2020-04-18 14:52 Draymond 阅读(1324) 评论(0) 推荐(0) 编辑
摘要: cap模型 CAP原则又称CAP定理,指的是在一个分布式系统中,一致性(Consistency)、可用性(Availability)、分区容错性(Partition tolerance)。CAP 原则指的是,这三个要素最多只能同时实现两点,不可能三者兼顾 一致性(Consistency):同一时间看 阅读全文
posted @ 2020-04-18 14:32 Draymond 阅读(21071) 评论(0) 推荐(0) 编辑
摘要: 1:pom <!-- nacos-discovery --> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> 阅读全文
posted @ 2020-04-18 14:19 Draymond 阅读(1179) 评论(0) 推荐(0) 编辑
摘要: 1:作用 本地调试的时候,不用跑相同的项目,就可以模拟多个相同服务的实例 2:步骤 2.1 右键payment copy configuaration 2.2 修改名字 与 VM options -DServer.port=9011 9001端口映射到9011 2.3 nacos查看 2.4 访问测 阅读全文
posted @ 2020-04-18 13:32 Draymond 阅读(392) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 11 下一页