Spring Cloud: How To Use Feign Without Ribbon
I'd like to use Feign without the Ribbon Loadalancer because I don't want to run Eureka, which needs to be distributed and available. Instead, internal ELBs with internal DNS names managed by Route53 will only do penalties.
Providing simple urls @FeignClient
always results in no loadbalancer found for ..
, so I tried to prevent using Feign with a ribbon:
Spring Cloud Netflix comes with FeignRibbonClient
, which is used if present ILoadBalancer
from ribbon-loadbalancer
. However, if this dependency is excluded, it is violated FeignConfiguration
:
Bean creation exception on FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apiVersionClient': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: feign.codec.Decoder org.springframework.cloud.netflix.feign.FeignConfiguration.decoder; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
Ideas are welcome :-)
source to share