一 代码位置
https://github.com/cakin24/spring-cloud-code/tree/master/ch14-5
二 启动consul
consul agent -dev -ui
三 测试
1 启动consul-override-provider-tag1
2 启动consul-override-provider-tag2
3 启动consul-override-consumer-new
4 浏览器输入 : http://localhost:8084/hello2?name=cakin
5 控制台输出如下,说明重写ConsulServerList生效
===== 自定义服务发现 =====
===== 自定义服务发现 =====
===== 自定义服务发现 =====