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

No CircuitBreakerNameResolver set in circuitBreakerFeignBuilder Bean

Open nanobot248 opened this issue 5 months ago • 0 comments
trafficstars

We are trying to use Feign with Resilience4j, but without the @EnableFeignClients annotation. When trying to use the circuitBreakerFeignBuilder Bean created in https://github.com/spring-cloud/spring-cloud-openfeign/blob/c53d5565cb5d5c32e73a1b07bf835441a4c51132/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsConfiguration.java#L232 to create Feign clients (via the target method), the following exception is thrown:

java.lang.NullPointerException: Cannot invoke "org.springframework.cloud.openfeign.CircuitBreakerNameResolver.resolveCircuitBreakerName(String, feign.Target, java.lang.reflect.Method)" because "this.circuitBreakerNameResolver" is null
	at org.springframework.cloud.openfeign.FeignCircuitBreakerInvocationHandler.invoke(FeignCircuitBreakerInvocationHandler.java:98)
...

Unfortunately, the four FeignCircuitBreaker.Builder methods circuitBreakerFactory, feignClientName, circuitBreakerGroupEnabled and circuitBreakerNameResolver are not public, therefore it is not possible to set the circuitBreakerNameResolver (without reflection).

It would be nice having either a working circuitBreakerFeignBuilder bean or to be able to set the properties manually.

nanobot248 avatar Jun 18 '25 11:06 nanobot248