I have the below 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);
}
}
}
When the FooMS instance is down, I get a 500 error instead of the fallback being executed. Why is this happening?
adding @Component and feign.hystrix.enabled=true works fine
Tag your CustomerFeignImpl as a @Component or create a @Bean out of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With