亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java - spring cloud eureka,ribbon restTemplate 訪問問題
黃舟
黃舟 2017-04-18 10:33:22
0
4
724


入圖,在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)心的淡定與從容!

reply all(4)
Peter_Zhu

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...

小葫蘆

help me....Everyone

左手右手慢動作

Have you configured this@EnableDiscoveryClientannotation?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template