在上一篇的基礎上進行增加,有興趣可以看一下,https://blog.csdn.net/baidu_37302589/article/details/100881769
1.首先在eureka-client-01新建controller方法
2.再在eureka-client-02中注入RestTemplate實例,並開啓負載均衡
3.創建TestController使用RestTemplate調用eureka-client-01中的hello方法並返回結果
4.訪問http://localhost:8763/test/sendMsg?name=admin就能看到hello打印傳遞的值
想了解更多的RestTemplate相關知識可以參考大佬的博客