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 :-)

+3


source to share


1 answer


If you want to use a simple url use @FeignClient(value="http://example.com", loadbalance=false)



With the Brixton release, you can use @FeignClient(url="http://example.com", name="example")

+9


source







All Articles