当前位置:网站首页>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 .
边栏推荐
- [STM32 learning] (8) stm32f1 general timer configuration
- Is CITIC Securities a safe and reliable securities firm? How to open an account?
- [example] v-contextmenu right click menu component
- [STM32 learning] (6) use of serial port 1 (usart1)
- TypeError: Object of type ‘int32‘ is not JSON serializable
- At the moment of the epidemic, we need to work harder, aoligui
- Curse of knowledge
- Looting (leetcode-198)
- Arduino drive lcd1602a
- What if path is deleted by mistake when configuring system environment variables?
猜你喜欢
![[STM32 learning] (16) STM32 realizes LCD1602 display (74HC595 drive) - 4-bit bus](/img/8f/19b0eb959d2b3f896c8e99f8e673d1.png)
[STM32 learning] (16) STM32 realizes LCD1602 display (74HC595 drive) - 4-bit bus

Spark Learning: how to choose different association forms and mechanisms?
![[STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus](/img/6b/b49b9e7fff62026a4818561d79fe3f.png)
[STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus

Detailed LinkedList

What's the difference between testing / developing programmers' professionalism and salted fish? They don't want to be excellent coders?

Ask you to build a small program server

Dynamic planning: robbing families and houses

Vscode failed to use SSH Remote Connection (and a collection of other problems)
![Calculate CPU utilization [Prometheus]](/img/00/d9f297e3013cabbf3d41be58105fc7.png)
Calculate CPU utilization [Prometheus]

Spark Learning: build SQL to meet the specified optimization rules
随机推荐
[robot learning] mechanism kinematics analysis and MATLAB simulation (3D model +word report +matlab program)
Value on the object Z rotation synchronization panel in unity
In the envy of LETV, there is a "meaning crisis" of contemporary workers
How to solve command 'xxx GCC' not found, but can be installed with:??
Centos7 install mysql8.0
System a uses window.open to call system B, and system B carries data back to system a after processing the business
Raspberry Pie: serial port login does not display print information
[STM32 learning] (8) stm32f1 general timer configuration
Home raiding II (leetcode-213)
[STM32 learning] (17) STM32 realizes LCD12864 display serial implementation
Simple parsing JSON strings with regular expressions
LiteOS_ a - SYS_ The run() function is missing a header file.
cannot unpack non-iterable NoneType object
What happens from the input URL to the page load
二叉树、二叉树排序树的实现及遍历
Arduino drive Lora module master node
[STM32 learning] (7) use of serial port 2 (usart2)
How to improve office efficiency through online collaborative documents
[STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus
Android Version Description security privacy 13