Skip to content
Advertisement

Spring cloud : Can not get Feign client to work with consul

I am trying to set up a simple spring cloud consul app.

I have a “distribution” service up and registered in consul (with the spring.application.name property set to “distribution”)

I have an “acquisition” service that is trying to make a call to the “distribution” service using feign.

Here is my main class

JavaScript

here is my feign client

JavaScript

and here is my pom.xml

JavaScript

When I request the “/disco” Url, the url of the “distribution” service is properly retrieved, which means that the whole discovery thing is working as expected.

But, when I request the “/use-feign” url, I get the following exception :

com.netflix.client.ClientException: Load balancer does not have available server for client: distribution at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:468) ~[ribbon-loadbalancer-2.2.0.jar:2.2.0] at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184) ~[ribbon-loadbalancer-2.2.0.jar:2.2.0] at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180) ~[ribbon-loadbalancer-2.2.0.jar:2.2.0] at rx.Observable.unsafeSubscribe(Observable.java:8460) ~[rxjava-1.1.5.jar:1.1.5] at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:94) ~[rxjava-1.1.5.jar:1.1.5] at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42) ~[rxjava-1.1.5.jar:1.1.5]

Am I missing any configuration ?

Thank you for your help.

Advertisement

Answer

spencergibb pointed out the problem : no health check endpoint was deployed. Just adding spring-boot-actuator to the dependencies solved the issue.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement