Class LoadBalancerWebClientHttpServiceGroupConfigurer

java.lang.Object
org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerWebClientHttpServiceGroupConfigurer
All Implemented Interfaces:
org.springframework.core.Ordered, org.springframework.web.reactive.function.client.support.WebClientHttpServiceGroupConfigurer, org.springframework.web.service.registry.HttpServiceGroupConfigurer<org.springframework.web.reactive.function.client.WebClient.Builder>

public class LoadBalancerWebClientHttpServiceGroupConfigurer extends Object implements org.springframework.web.reactive.function.client.support.WebClientHttpServiceGroupConfigurer
Load-balancer-specific WebClientHttpServiceGroupConfigurer implementation. If the group baseUrl is null, sets up a baseUrl with LoadBalancer serviceId -resolved from HTTP Service Client groupName set as host. If the group baseUrl is null or has lb set as its scheme, a DeferringLoadBalancerExchangeFilterFunction instance picked from application context is added to the group's WebClient.Builder if available, allowing for the requests to be load-balanced.
Since:
5.0.0
Author:
Olga Maciaszek-Sharma
See Also:
  • WebClient.Builder
  • HttpServiceClientProperties
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.web.service.registry.HttpServiceGroupConfigurer

    org.springframework.web.service.registry.HttpServiceGroupConfigurer.ClientCallback<CB>, org.springframework.web.service.registry.HttpServiceGroupConfigurer.GroupCallback<CB>, org.springframework.web.service.registry.HttpServiceGroupConfigurer.Groups<CB>, org.springframework.web.service.registry.HttpServiceGroupConfigurer.InitializingClientCallback<CB>, org.springframework.web.service.registry.HttpServiceGroupConfigurer.ProxyFactoryCallback
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    LoadBalancerWebClientHttpServiceGroupConfigurer(org.springframework.beans.factory.ObjectProvider<DeferringLoadBalancerExchangeFilterFunction<LoadBalancedExchangeFilterFunction>> exchangeFilterFunctionProvider, org.springframework.boot.http.client.autoconfigure.service.HttpServiceClientProperties httpServiceClientProperties)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    configureGroups(org.springframework.web.service.registry.HttpServiceGroupConfigurer.Groups<org.springframework.web.reactive.function.client.WebClient.Builder> groups)
     
    int
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LoadBalancerWebClientHttpServiceGroupConfigurer

      public LoadBalancerWebClientHttpServiceGroupConfigurer(org.springframework.beans.factory.ObjectProvider<DeferringLoadBalancerExchangeFilterFunction<LoadBalancedExchangeFilterFunction>> exchangeFilterFunctionProvider, org.springframework.boot.http.client.autoconfigure.service.HttpServiceClientProperties httpServiceClientProperties)
  • Method Details

    • configureGroups

      public void configureGroups(org.springframework.web.service.registry.HttpServiceGroupConfigurer.Groups<org.springframework.web.reactive.function.client.WebClient.Builder> groups)
      Specified by:
      configureGroups in interface org.springframework.web.service.registry.HttpServiceGroupConfigurer<org.springframework.web.reactive.function.client.WebClient.Builder>
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.web.service.registry.HttpServiceGroupConfigurer<org.springframework.web.reactive.function.client.WebClient.Builder>
      Specified by:
      getOrder in interface org.springframework.core.Ordered