美文网首页
Ribbon支持的配置项,以及如何使用

Ribbon支持的配置项,以及如何使用

作者: G__yuan | 来源:发表于2021-03-11 21:44 被阅读0次

1:下图为Ribbon支持的配置项

image.png

2:配置项的使用

a:通过提供bean的方式

比如将IPing的默认值DummyPing换成PingUrl,在代码中提供如下bean

@Configuration
public class RibbonConfiguration {
    @Bean
    public IPing iPing(){ return new PingUrl(); }
}

b:通过配置属性的方式

neofaith-wechat-web.ribbon.NFLoadBalancerRuleClassName=com.netflix.loadbalancer.RandomRule
image.png

相关文章

网友评论

      本文标题:Ribbon支持的配置项,以及如何使用

      本文链接:https://www.haomeiwen.com/subject/smwoqltx.html