spring cloud load balancing

Netfilx Ribbon core interface

  The actual request of the client

    LoadBalancerClient

      RibbonLoadBalancerClient

  Load balancing context

    LoadBalanceContext

      RibbonLoadBalanceContext

  Load Balancer

    lLoadBalancer  

      BaseLoadBalancer  

      DynamicServerListLoadBalancer

      ZoneAwareLoadBalancer

      NoOpLoadBalancer

  Rules Interface

    IRule

      Random Rules: RandomRule

      The most available rules: BestAvailableRule

      Round Robin rules: RoundRobinRule

      Retry realization: RetryRule

      Client Configuration: ClientConfigEnabledRoundRobinRule

      You can filter rule: AvailabilityFilteringRule

      RT weighting rules: WeightedResponseTimeRule

      Avoid regional rules: ZoneAvoidanceRule

  Check the machine is alive PING strategy

    IPingStrategy

      NoOping

      DummyPing

      PingConstant

      PingUrl

      NIWSDiscoveryPing

  Load balancing client

    main duty

    LoadBalancerClient

      Conversion url: URL containing the application name is converted into the form of specific host port +

      Select the service instance: by load balancing algorithm, a specified server instance

      Request a callback: After you select for the service instance, the implementation of a specific request callbacks

    The default implementation

      RibbonLoadBalancerClient

    Automated assembly

      RibbonAutoConfiguration#loadBalancerClient() 

  LoadBalancerContext

    Conversion Url: URL containing the application name is converted into the form of specific host port +

    Components association: association RetryHandler, ILoadBalancer etc.

    Records Service statistics, records request response time, number of errors, etc.

    The default implementation: RibbonLoadBalancerContext   

    Automated assembly

      RibbonAutoConfiguration#loadBalancerContext()

  ILoadBalancer 

    main duty

      Increase server

      Get the server: Get through the associated key, get a list of all services for a list of available services

      Server Status: Server down marker

    The default implementation: ZonnAwareLoadBalancer  

    Autowiring: RibbonAutoConfiguration # ribbonLoadBalancer ()

  IRule

    main duty

      Server selection: the load balancer and associated key, obtaining a candidate server

      The default implementation: ZoneAvoidanceRule

      Autowiring: RibbonAutoConfiguration # ribbonRule ()

  IPing

    main duty

      Activity Detection: according to the specified server to detect whether their activities

      The default implementation: Dummyping

      Autowiring: RibbonAutoConfiguration # ribbonPing ()

  server list

   ServerList

      main duty

        Get a list of server initialization

        Get updates server list

        The default implementation: ConfigurationBasedServerList or DiscoveryEnabledNiWSServerList

        Automatic assembly: RibbonAutoConfiguration #

    Netflix Ribbon autowiring

      RibbonAutoConfiguration

        LoadBalancerClient

        PropertiesFactory

      LoadBalancerAutoConfiguration

        @LoadBalanced

        rest Template

  Ribbon client configuration

    RibbonClientConfiguration

      LoadBalancerContext 

      IRule

      IPing

      ServerList

      ILoadBalancer

      IClientConfig

 

   Netflix Ribbon configuration of components

    PropertiesFactory

      ILoadBalancer

      iPing

      IRule

      ServerList

      ServerListFilter

  Call link

    Select the server logic

    LoadBalancerClient(RibbonLoadBalancerClient)->ILoadBalancer(ZonnAwareLoadBalancer)->IRule(ZoneAvoidanceRule)

    

  

 

Guess you like

Origin www.cnblogs.com/blair-sun/p/11593998.html
Recommended