Content-Length: 260532 | pFad | http://github.com/patinousward/spring-cloud-openfeign-lb-plugin

82 GitHub - patinousward/spring-cloud-openfeign-lb-plugin: spring cloud openfeign 自定义负载均衡(loadbalance)插件,可细化到接口
Skip to content

spring cloud openfeign 自定义负载均衡(loadbalance)插件,可细化到接口

License

Notifications You must be signed in to change notification settings

patinousward/spring-cloud-openfeign-lb-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-cloud-openfeign-lb-plugin

1.QuickStart

  • 1.1 自定义负载均衡规则

自定义类继承AbstractLBRule,rule方法中填充自己的负载均衡算法即可,可参考HashLBRule这个实现类

  • 1.2 在feign接口中显示调用url,其值为负载均衡规则的name,example:
@FeignClient(value= "xxx",url = HashLBRule.NAME)
public interface MyFeign{
}
  • 1.3 创建bean即可,example:
@Configuration
public class CustomizeBeanConfiguration{
    
    @Bean
    public LBRule getLBRule(){
        return new HashLBRule(MyFeign.class,"key")
    }

    @Bean
    public LBRule getLBRule2(){
        return new HashLBRule2(MyFeign2.class,"key")
    }

    xxx

}

About

spring cloud openfeign 自定义负载均衡(loadbalance)插件,可细化到接口

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/patinousward/spring-cloud-openfeign-lb-plugin

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy