上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 114 下一页
摘要: Eureka包含四个部分的配置 Eureka Instance实例信息配置 Eureka Instance的配置信息全部保存在org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean配置类里,实际上它是com.netflix. 阅读全文
posted @ 2018-09-05 18:03 甜菜波波 阅读(10341) 评论(0) 推荐(1)
摘要: 一、什么情况下会触发fallback方法? 名字 描述 触发fallback EMIT 值传递 NO SUCCESS 执行完成,没有错误 NO FAILURE 执行抛出异常 YES TIMEOUT 执行开始,但没有在允许的时间内完成 YES BAD_REQUEST 执行抛出HystrixBadReq 阅读全文
posted @ 2018-09-05 11:16 甜菜波波 阅读(1102) 评论(0) 推荐(0)
摘要: 1.注解配置 2.启动类配置 3.属性配置 4.设置resttemplate的超时时间(这个超时时间不知道是否与熔断有关) 阅读全文
posted @ 2018-09-05 10:46 甜菜波波 阅读(384) 评论(0) 推荐(0)
摘要: eureka: client: register-with-eureka: true serviceUrl: defaultZone: http://localhost:8761/eureka/ server: port: 8765 spring: application: name: gateway-zuul zuul: retryabl... 阅读全文
posted @ 2018-09-05 10:36 甜菜波波 阅读(687) 评论(0) 推荐(0)
摘要: Ribbon超时与Hystrix超时问题,为了确保Ribbon重试的时候不被熔断,我们就需要让Hystrix的超时时间大于Ribbon的超时时间,否则Hystrix命令超时后,该命令直接熔断,重试机制就没有任何意义了。 service-hi: ribbon: ReadTimeout: 2000 Co 阅读全文
posted @ 2018-09-05 10:29 甜菜波波 阅读(4903) 评论(0) 推荐(0)
摘要: 配置实例 阅读全文
posted @ 2018-09-04 17:15 甜菜波波 阅读(1119) 评论(0) 推荐(0)
摘要: package com.example.demo; import com.netflix.hystrix.HystrixCommand; //import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.netflix.hystrix.HystrixCommandGroupKey; impor... 阅读全文
posted @ 2018-09-04 16:03 甜菜波波 阅读(954) 评论(0) 推荐(0)
摘要: 序 feign默认集成了hystrix,那么问题来了,如何像hystrix command那样设置每个方法的hystrix属性呢。 实例 FeignClientsConfiguration spring-cloud-netflix-core-1.2.6.RELEASE-sources.jar!/or 阅读全文
posted @ 2018-09-04 16:01 甜菜波波 阅读(4566) 评论(0) 推荐(0)
摘要: 1.pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instan 阅读全文
posted @ 2018-09-04 15:30 甜菜波波 阅读(461) 评论(1) 推荐(0)
摘要: Ribbon超时与Hystrix超时问题,为了确保Ribbon重试的时候不被熔断,我们就需要让Hystrix的超时时间大于Ribbon的超时时间,否则Hystrix命令超时后,该命令直接熔断,重试机制就没有任何意义了。 hystrix: command: default: execution: ti 阅读全文
posted @ 2018-09-04 14:38 甜菜波波 阅读(1035) 评论(0) 推荐(0)
上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 114 下一页