我有以下 FeignClient:
@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);
}
}
}
当 FooMS 实例关闭时,我收到 500 错误,而不是执行回退。为什么会这样?
最佳答案
添加 @Component 和 feign.hystrix.enabled=true 效果很好
关于java - Feign Hystrix 回退不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46428434/