spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

Provide an attribute to ignore certain exceptions for Feign Hystrix support

Open asarkar opened this issue 10 years ago • 5 comments

The @FeignClient annotation has an attribute fallback, named appropriately. It'd be nice to have an attribute Class<? extends Throwable>[] ignoreExceptions() default {} that doesn't open the circuit for the exceptions listed. Currently, the workaround is to disable feign support (feign.hystrix.enabled=false will do it globally) and annotate the caller of the feign client with com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand. This is more code to implement what I assume is a common use case. Also, if any ErrorDocoder is present, ignoreExceptions should honor it, that is give the decoder a chance to translate HTTP status code to exceptions.

See the SO thread here for background.

asarkar avatar Sep 15 '16 19:09 asarkar

+1, I'm looking for this feature because our services are using HTTP status code to identify the expected business exception. 4xx response should not to use the fallback method.

starlight36 avatar Oct 12 '16 07:10 starlight36

++

ledbruno avatar Jun 26 '17 17:06 ledbruno

+1

tiyunlong avatar Jul 04 '17 07:07 tiyunlong

++

WoojinAhn avatar Feb 19 '20 09:02 WoojinAhn

Hystrix has entered maintenance mode. This means that the Spring Cloud team will no longer be adding new features to the module. We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community.

spencergibb avatar Feb 19 '20 12:02 spencergibb