spring cloud gateway 权重路由
权重路由可将客户请求按设置的比例随机分发给后端的服务器
**************************
示例
配置文件
spring:
cloud:
gateway:
routes:
- id: custom_route
uri: http://www.baidu.com
predicates:
- Path=/hello
- Weight=group1,2
filters:
- StripPrefix=1
- id: custom_route2
uri: http://www.jd.com
predicates:
- Path=/hello
- Weight=group1,1
filters:
- StripPrefix=1
说明:请求localhost:8080/hello按2:1的比例跳转到对应的uri