Java 假装Hystrix后撤不起作用
我有以下假客户:Java 假装Hystrix后撤不起作用,java,spring-boot,hystrix,netflix-feign,spring-cloud-feign,Java,Spring Boot,Hystrix,Netflix Feign,Spring Cloud Feign,我有以下假客户: @FeignClient(name="FooMS",fallback=CustomerFeign.CustomerFeignImpl.class) public interface CustomerFeign { @RequestMapping(value="/bar/{phoneNo}") List<Long> getFriends(@PathVariable("phoneNo") Long phoneNo); class Custo
@FeignClient(name="FooMS",fallback=CustomerFeign.CustomerFeignImpl.class)
public interface CustomerFeign {
@RequestMapping(value="/bar/{phoneNo}")
List<Long> getFriends(@PathVariable("phoneNo") Long phoneNo);
class CustomerFeignImpl implements CustomerFeign{
@Override
public List<Long> getFriends(Long phoneNo) {
return new ArrayList<Long>(108);
}
}
}
@FeignClient(name=“FooMS”,fallback=CustomerFeign.CustomerFeignImpl.class)
公共接口CustomerFeign{
@请求映射(value=“/bar/{phoneNo}”)
列出getFriends(@PathVariable(“phoneNo”)长phoneNo);
类CustomerFeignImpl实现CustomerFeign{
@凌驾
公共列表好友(长电话号码){
返回新的ArrayList(108);
}
}
}
当FooMS实例关闭时,我得到一个500错误,而不是正在执行的回退。为什么会发生这种情况?将您的
客户feignimpl
标记为@组件
,或者从中创建@Bean
将您的客户feignimpl
标记为@组件
,或从中创建@Bean
添加@Component and feign.hystrix.enabled=true效果良好添加@Component and feign.hystrix.enabled=true效果良好能否共享堆栈跟踪?能否共享堆栈跟踪?谢谢。我还必须添加feign.hystrix.enabled=true属性。我发现我无法通过属性文件修改hystrix超时。即使我给出,hystrix.command.default.execution.isolation.thread.TIMEOUTIMESS=50000或hystrix.command.getFriends.execution.isolation.thread.TIMEOUTIMESS=50000,hystrix with FIGN仍会在1秒内超时。知道我该怎么解决吗?谢谢。我还必须添加feign.hystrix.enabled=true属性。我发现我无法通过属性文件修改hystrix超时。即使我给出,hystrix.command.default.execution.isolation.thread.TIMEOUTIMESS=50000或hystrix.command.getFriends.execution.isolation.thread.TIMEOUTIMESS=50000,hystrix with FIGN仍会在1秒内超时。你知道我该怎么解决这个问题吗?