入圖,在eureka中心已經(jīng)有了這個服務者,服務者的配置信息如下
但是通過以下代碼:
訪問時一直提示:
I/O error on GET request for "http://client": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
請問該怎么把,就是好像沒辦法用實例名訪問?
謝謝各位的回答,已經(jīng)解決了!是我自己的問題。。
人生最曼妙的風景,竟是內(nèi)心的淡定與從容!
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...