Ribbon load balancing strategy and configuration, lazy loading and hungry loading of Ribbon

Ribbon's load balancing strategy is under the IRule interface. After we configure the Ribbon's strategy, various service selection methods can take effect.
Load balancing strategy:
insert image description here
strategy introduction:
insert image description here

Using Ribbon's load balancing strategy

insert image description here
1. Configure a bean that returns a policy rule and register it in the spring container, so that the rule can be used globally.
But note: the service consumer of this module will use this rule no matter what service it calls, which is a global configuration
2 , Configure in the yml or properties file, set the rules after the service name, you can use the configured rules when calling this service, and call other services without being affected

Ribbon lazy loading

insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/dayuiicghaid/article/details/126003427