属性配置方式能够配置全局的负载均衡规则吗?

来源:6-14 扩展Ribbon-支持Nacos权重

度她余生

2019-08-29

属性配置方式能够配置全局的负载均衡规则吗?

实际项目中调用各个微服务时,单独配置调用各服务的负载均衡方式的多,还是调用各服务都用统一的负载均衡方式多呢?

写回答

1回答

大目

2019-08-29

属性无法全局配置哦。

实际项目看你的需求哈,就我个人的经验来看,用全局配置相对更多一些。

0
3
大目
回复
度她余生
您好,官方文档说的是属性 > 代码优先级哈。 https://cloud.spring.io/spring-cloud-static/Greenwich.SR2/single/spring-cloud.html#_customizing_the_ribbon_client_by_setting_properties Classes defined in these properties have precedence over beans defined by using @RibbonClient(configuration=MyRibbonConfig.class) and the defaults provided by Spring Cloud Netflix. 不过我没有亲测过。实际项目中应该尽量避免优先级这种东西。
2019-08-30
共3条回复

Spring Cloud Alibaba微服务从入门到进阶

面向未来微服务:熟练掌握Spring Cloud Alibaba

3085 学习 · 1324 问题

查看课程