I\'m trying to use Feign client. Below is my feing client:
import com.eprogrammerz.examples.domain.Movie;
import org.springframework.cloud.netflix.feign.Feig
It seems like that ClientAppApplication doesn't know your eureka server's address.
You could check you applation.yml
eureka
instance:
hostname: cloud-feignorder-consume
client:
register-with-eureka: false #default true
fetch-registry: true #default true
The last line you should check the property 'eureka.client.fetch-registry'.It should be true or not sign.Then your client could get the server list from eureka server.
Without eureka, in client app, if you dont have application.yml rather application.properties file, then you can set the property as below before the client app restart :
currency-exchange-service.ribbon.listOfServers : http://localhost:8000,http://localhost:8001
I nearly wasted 2 hours to find the root cause. I mistakenly imported EnableEurekaClient in client application, which was the root cause for the issue. I finally resolved this issue by removing the import. To my surprise @EnableDiscoveryClient does not require the below dependency. But if you are using Eureka Naming server than this has to be used.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
The problem is that your service doesn't know the host of the requested service. If you are using Eureka and zuul, put this line on your zuul .properties or .yml file :
eureka.client.fetch-registry=true
After doing research, and with help of @Bloodysock, I found that I was missing registration of remote server in 'client-app' micro-service. The document is at Spring Cloud Netflix.
I used Ribbon without Eureka with configuration in application.yml in 'client-app' micro-service as:
movie-api:
ribbon:
listOfServers: http://localhost:8090
The problem is that your service doesn't know the host of requested service. If you are using Eureka, put this line on your .properties or .yml file:
eureka.client.fetchRegistry=true
OR
eureka:
client:
fetchRegistry: true
It'll make your service talk with Eureka and discovers host of requested service.