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端口返回的數據

