入图,在eureka中心已经有了这个服务者,服务者的配置信息如下
但是通过以下代码:
访问时一直提示:
I/O error on GET request for "http://client": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
请问该怎么把,就是好像没办法用实例名访问?
谢谢各位的回答,已经解决了!是我自己的问题。。
天蓬老师2017-04-18 10:35:22
This is what the official document says
@Autowired
private EurekaClient discoveryClient;
public String serviceUrl() {
InstanceInfo instance = discoveryClient.getNextServerFromEureka("STORES", false);
return instance.getHomePageUrl();
}
The access methods are different
Please refer to http://cloud.spring.io/spring...