当前位置:网站首页>How does ribbon get the default zoneawareloadbalancer?
How does ribbon get the default zoneawareloadbalancer?
2022-07-24 09:58:00 【Happy Valley melodious】
1.ILoadBalancer family


2.ZoneAwareLoadBalancer Where was it declared ?
From the previous articles, I can see the default LoadBalancer yes ZoneAwareLoadBalancer, Where did it state ?
stay org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration in 
as for RibbonClientConfiguration How to load is detailed , stay Ribbon Automatic injection , There is an initialization SpringClientFactory .

3. have a look ZoneAwareLoadBalancer What is needed for the creation of ?
@Bean
@ConditionalOnMissingBean
public ILoadBalancer ribbonLoadBalancer(
IClientConfig config, // Client configuration
ServerList<Server> serverList, // List of services
ServerListFilter<Server> serverListFilter, // Service filter
IRule rule, // Service selection rules
IPing ping, // Service detection tools
ServerListUpdater serverListUpdater // Service regular update tool
) {
if (this.propertiesFactory.isSet(ILoadBalancer.class, name)) {
return this.propertiesFactory.get(ILoadBalancer.class, config, name);
}
return new ZoneAwareLoadBalancer<>(config, rule, ping, serverList,
serverListFilter, serverListUpdater);
}
What you need :
- IClientConfig config, // Client configuration
- ServerList serverList, // List of services
- ServerListFilter serverListFilter, // Service filter
- IRule rule, // Service selection strategy
- IPing ping, // Service detection tools
- ServerListUpdater serverListUpdater // Service regular update tool
Where did these objects come from ? It's all in RibbonClientConfiguration Declarative . It also represents ribbon Default configuration 





In these classes , except RibbonLoadBalancerClient No other , Other core classes are here .ZoneAwareLoadBalancer How to get , And creating the required objects can basically be done in RibbonClientConfiguration in . Of course , Everything here is default ,ConditionalOnMissingBean This annotation is to tell spring, If other places have creation related bean, There is no longer initialization .
边栏推荐
- Jenkins deploys the project and prompts that the module package defined by him cannot be found
- Color recognition of regions of interest in pictures and videos based on OpenCV
- Excuse me, what are the financial products with an annual interest rate of 6%
- Dynamic planning: robbing families and houses
- Home raiding III (leetcode-337)
- Firewalld firewall related commands
- What happens from the input URL to the page load
- At the moment of the epidemic, we need to work harder, aoligui
- Cyclicbarrier and countdownlatch [concurrent programming]
- Yarn: unable to load file
猜你喜欢

Do you really understand the concept of buffer? Take you to uncover the buffer zone~

ASI-20220222-Implicit PendingIntent

This article takes you to understand the dynamic memory allocation of C language

2022 trusted cloud authoritative assessment released: Tianyi cloud has obtained ten certifications and five best practices
![[STM32 learning] (14) two 74HC595 controls four nixie tube displays](/img/22/c83e29bead8e6298a0a3564419022c.png)
[STM32 learning] (14) two 74HC595 controls four nixie tube displays

程序的编译与链接

What if path is deleted by mistake when configuring system environment variables?
![Learn more about the synchronized lock upgrade process [concurrent programming]](/img/d8/a74d0e151aa16d4a02566a8a822285.png)
Learn more about the synchronized lock upgrade process [concurrent programming]

Web page opening speed is very slow, how to solve it?

Dark king | analysis of zego low illumination image enhancement technology
随机推荐
CAS principle [concurrent programming]
PHP debugging tool - socketlog installation and usage
[STM32 learning] (4) press the key to control the flow light
二叉树、二叉树排序树的实现及遍历
[STM32 learning] (6) use of serial port 1 (usart1)
Knapsack problem of dynamic programming -- three lectures on knapsack (01 knapsack, complete knapsack, multiple knapsack)
聚集日志服务器
Where is the bitbucket clone address
Cess test online line! The first decentralized storage network to provide multiple application scenarios
详解LinkedList
程序的编译与链接
[C language] implementation of three versions of address book small project (including source code)
[200 opencv routines] 236. Principal component analysis of feature extraction (openCV)
AttributeError: module ‘sipbuild. api‘ has no attribute ‘prepare_ metadata_ for_ build_ wheel‘
Arduino drive lcd1602a
How to solve command 'xxx GCC' not found, but can be installed with:??
PHP Basics - PHP magic method
Web page opening speed is very slow, how to solve it?
配置系统环境变量的时候误删了Path怎么办?
C # +opencvsharp+wpf learning notes (I)