backend_show_consumer工程
1、在 中配置FeignClient,name为back_show_provider的hello-service-provider

2、负载均衡器配置如下
@Configuration
public class RestConfig {
@Bean
@LoadBalanced
public RestTemplate restTemplate(){
return new RestTemplate();
}
/**
* 负载均衡规则
* @return
*/
@Bean
public IRule iRule(){
return new RoundRobinRule();
//return new MyRule();
}
@Bean
public IPing iPing(){
//return new PingUrl(false,"/abc");
return new NIWSDiscoveryPing();
}
}
3、测试
来自7101端口服务返回的数据

俩字7102端口返回的数据
