Class ServiceInstanceListSupplierBuilder
java.lang.Object
org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplierBuilder
A Builder for creating a
ServiceInstanceListSupplier hierarchy to be used in
ReactorLoadBalancer configuration.- Author:
- Spencer Gibb, Olga Maciaszek-Sharma, Zhiguo Chen, Sabyasachi Bhattacharya, Zhuozhi Ji
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAllows creating aServiceInstanceListSupplierinstance based on providedConfigurableApplicationContext.static interfaceAllows creating aServiceInstanceListSupplierinstance based on providedConfigurableApplicationContextand anotherServiceInstanceListSupplierinstance that will be used as a delegate. -
Method Summary
Modifier and TypeMethodDescriptionbuild(org.springframework.context.ConfigurableApplicationContext context) Builds theServiceInstanceListSupplierhierarchy.with(@Nullable ServiceInstanceListSupplierBuilder.DelegateCreator delegateCreator) SupportServiceInstanceListSupplierBuildercan be added to the expansion implementation ofServiceInstanceListSupplierby this method.withBase(ServiceInstanceListSupplier supplier) Sets a user-providedServiceInstanceListSupplieras a baseServiceInstanceListSupplierin the hierarchy.Sets a blockingDiscoveryClient-basedDiscoveryClientServiceInstanceListSupplieras a baseServiceInstanceListSupplierin the hierarchy.Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedRestTemplateinstance to theServiceInstanceListSupplierhierarchy.withBlockingHealthChecks(org.springframework.web.client.RestClient restClient) Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedRestClientinstance to theServiceInstanceListSupplierhierarchy.withBlockingHealthChecks(org.springframework.web.client.RestTemplate restTemplate) Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedRestTemplateinstance to theServiceInstanceListSupplierhierarchy.Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedRestClientinstance to theServiceInstanceListSupplierhierarchy.IfLoadBalancerCacheManageris available in the context, adds aCachingServiceInstanceListSupplierinstance to theServiceInstanceListSupplierhierarchy to provide a caching mechanism for service instances.Sets aReactiveDiscoveryClient-basedDiscoveryClientServiceInstanceListSupplieras a baseServiceInstanceListSupplierin the hierarchy.Adds aHealthCheckServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.withHealthChecks(org.springframework.web.reactive.function.client.WebClient webClient) Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedWebClientinstance to theServiceInstanceListSupplierhierarchy.Adds aRequestBasedStickySessionServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.Adds aSameInstancePreferenceServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.Adds aWeightedServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.withWeighted(WeightFunction weightFunction) Adds aWeightedServiceInstanceListSupplierthat uses user-providedWeightFunctioninstance to theServiceInstanceListSupplierhierarchy.Adds aZonePreferenceServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.withZonePreference(String zoneName) Adds aZonePreferenceServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.
-
Method Details
-
withBlockingDiscoveryClient
Sets a blockingDiscoveryClient-basedDiscoveryClientServiceInstanceListSupplieras a baseServiceInstanceListSupplierin the hierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withDiscoveryClient
Sets aReactiveDiscoveryClient-basedDiscoveryClientServiceInstanceListSupplieras a baseServiceInstanceListSupplierin the hierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withBase
Sets a user-providedServiceInstanceListSupplieras a baseServiceInstanceListSupplierin the hierarchy.- Parameters:
supplier- a user-providedServiceInstanceListSupplierinstance- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withWeighted
Adds aWeightedServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withWeighted
Adds aWeightedServiceInstanceListSupplierthat uses user-providedWeightFunctioninstance to theServiceInstanceListSupplierhierarchy.- Parameters:
weightFunction- a user-providedWeightFunctioninstance- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withHealthChecks
Adds aHealthCheckServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withHealthChecks
public ServiceInstanceListSupplierBuilder withHealthChecks(org.springframework.web.reactive.function.client.WebClient webClient) Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedWebClientinstance to theServiceInstanceListSupplierhierarchy.- Parameters:
webClient- a user-providedWebClientinstance- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withSameInstancePreference
Adds aSameInstancePreferenceServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withBlockingHealthChecks
Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedRestTemplateinstance to theServiceInstanceListSupplierhierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withBlockingRestClientHealthChecks
Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedRestClientinstance to theServiceInstanceListSupplierhierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withBlockingHealthChecks
public ServiceInstanceListSupplierBuilder withBlockingHealthChecks(org.springframework.web.client.RestTemplate restTemplate) Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedRestTemplateinstance to theServiceInstanceListSupplierhierarchy.- Parameters:
restTemplate- a user-providedRestTemplateinstance- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withBlockingHealthChecks
public ServiceInstanceListSupplierBuilder withBlockingHealthChecks(org.springframework.web.client.RestClient restClient) Adds aHealthCheckServiceInstanceListSupplierthat uses user-providedRestClientinstance to theServiceInstanceListSupplierhierarchy.- Parameters:
restClient- a user-providedRestClientinstance- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withZonePreference
Adds aZonePreferenceServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withZonePreference
Adds aZonePreferenceServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.- Parameters:
zoneName- desired zone for zone preference- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withRequestBasedStickySession
Adds aRequestBasedStickySessionServiceInstanceListSupplierto theServiceInstanceListSupplierhierarchy.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withCaching
IfLoadBalancerCacheManageris available in the context, adds aCachingServiceInstanceListSupplierinstance to theServiceInstanceListSupplierhierarchy to provide a caching mechanism for service instances. UsesObjectProviderto lazily resolveLoadBalancerCacheManager.- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
withRetryAwareness
-
withHints
-
withSubset
-
withReactiveApiVersioning
-
withBlockingApiVersioning
-
with
public ServiceInstanceListSupplierBuilder with(@Nullable ServiceInstanceListSupplierBuilder.DelegateCreator delegateCreator) SupportServiceInstanceListSupplierBuildercan be added to the expansion implementation ofServiceInstanceListSupplierby this method.- Parameters:
delegateCreator- aServiceInstanceListSupplierBuilder.DelegateCreatorobject- Returns:
- the
ServiceInstanceListSupplierBuilderobject
-
build
public ServiceInstanceListSupplier build(org.springframework.context.ConfigurableApplicationContext context) Builds theServiceInstanceListSupplierhierarchy.- Parameters:
context- application context- Returns:
- a
ServiceInstanceListSupplierinstance on top of the delegate hierarchy
-