SpringCloud测试负载均衡 发表于 2018-03-26 | 分类于 SpringCloud | 阅读次数 测试SpringCloud 服务负载均衡12345678@Autowiredprivate DiscoveryClient client;@RequestMapping(value = "/add/{a}/{b}",method = RequestMethod.GET)public String add(@PathVariable Integer a,@PathVariable Integer b){ System.out.println("host:"+client.getLocalServiceInstance().getHost()+" -----port:"+client.getLocalServiceInstance().getPort()); return a+b+" ------ host:"+client.getLocalServiceInstance().getHost()+" -----port:"+client.getLocalServiceInstance().getPort();} 欢迎您扫一扫上面的微信公众号,订阅我的博客!