Class LoadBalancerRestClientHttpServiceGroupConfigurer
java.lang.Object
org.springframework.cloud.client.loadbalancer.LoadBalancerRestClientHttpServiceGroupConfigurer
- All Implemented Interfaces:
org.springframework.core.Ordered, org.springframework.web.client.support.RestClientHttpServiceGroupConfigurer, org.springframework.web.service.registry.HttpServiceGroupConfigurer<org.springframework.web.client.RestClient.Builder>
public class LoadBalancerRestClientHttpServiceGroupConfigurer
extends Object
implements org.springframework.web.client.support.RestClientHttpServiceGroupConfigurer
Load-balancer-specific
RestClientHttpServiceGroupConfigurer 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 DeferringLoadBalancerInterceptor instance picked from application
context is added to the group's RestClient.Builder if available, allowing for
the requests to be load-balanced.- Since:
- 5.0.0
- Author:
- Olga Maciaszek-Sharma
- See Also:
-
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.ProxyFactoryCallback -
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionLoadBalancerRestClientHttpServiceGroupConfigurer(org.springframework.beans.factory.ObjectProvider<DeferringLoadBalancerInterceptor> loadBalancerInterceptorProvider, org.springframework.boot.http.client.autoconfigure.service.HttpServiceClientProperties clientServiceProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureGroups(@NonNull org.springframework.web.service.registry.HttpServiceGroupConfigurer.Groups<org.springframework.web.client.RestClient.Builder> groups) intgetOrder()
-
Constructor Details
-
LoadBalancerRestClientHttpServiceGroupConfigurer
public LoadBalancerRestClientHttpServiceGroupConfigurer(org.springframework.beans.factory.ObjectProvider<DeferringLoadBalancerInterceptor> loadBalancerInterceptorProvider, org.springframework.boot.http.client.autoconfigure.service.HttpServiceClientProperties clientServiceProperties)
-
-
Method Details
-
configureGroups
public void configureGroups(@NonNull org.springframework.web.service.registry.HttpServiceGroupConfigurer.Groups<org.springframework.web.client.RestClient.Builder> groups) - Specified by:
configureGroupsin interfaceorg.springframework.web.service.registry.HttpServiceGroupConfigurer<org.springframework.web.client.RestClient.Builder>
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.web.service.registry.HttpServiceGroupConfigurer<org.springframework.web.client.RestClient.Builder>- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-