Ribbon服务请求调用流程
2020-10-14 14:35:18 11 举报
spring cloud Ribbon服务请求调用流程
作者其他创作
大纲/内容
spring.factories
InterceptingRequestExecution#execute
注入LoadBalancerClient
spring-cloud-commons.jar
AbstractBufferingClientHttpRequest#executeInternal()
DynamicServerListLoadBalancer
getLoadBalancer(serviceId)
负载均衡拦截器(注入LoadBalancerClient)
RibbonLoadBalancerClient#getServer()
AbstractClientHttpRequest#execute
RestTemplateCustomizer
EurekaServer
restOfInit()
EurekaClient#getInstancesByVipAddress()
DiscoveryEnabledNIWSServerList#obtainServersViaDiscovery
LoadBalancerInterceptor#intercept
LoadBalancerInterceptor
DynamicServerListLoadBalancer#updateListOfServers
LoadBalancerAutoConfiguration
RibbonClientConfiguration
RibbonLoadBalancerClient#execute()
给每个RestTemplate设置拦截器,这样每个@LoadBalanced注解的方法都会执行LoadBalancerInterceptor.interceptor()方法
其他Bean......
ZoneAwareLoadBalancer
HttpComponentsClientHttpRequest#executeInternal
0 条评论
下一页