Class SameInstancePreferenceServiceInstanceListSupplier
java.lang.Object
org.springframework.cloud.loadbalancer.core.DelegatingServiceInstanceListSupplier
org.springframework.cloud.loadbalancer.core.SameInstancePreferenceServiceInstanceListSupplier
- All Implemented Interfaces:
Supplier<reactor.core.publisher.Flux<List<org.springframework.cloud.client.ServiceInstance>>>, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, SelectedInstanceCallback, ServiceInstanceListSupplier
public class SameInstancePreferenceServiceInstanceListSupplier
extends DelegatingServiceInstanceListSupplier
implements SelectedInstanceCallback
An implementation of
ServiceInstanceListSupplier that selects the previously
chosen instance if it's available.- Since:
- 2.2.7
- Author:
- Olga Maciaszek-Sharma, Jürgen Kreitler
-
Field Summary
Fields inherited from class DelegatingServiceInstanceListSupplier
delegate -
Constructor Summary
ConstructorsConstructorDescriptionSameInstancePreferenceServiceInstanceListSupplier(ServiceInstanceListSupplier delegate, org.springframework.cloud.client.loadbalancer.reactive.ReactiveLoadBalancer.Factory<org.springframework.cloud.client.ServiceInstance> loadBalancerClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<List<org.springframework.cloud.client.ServiceInstance>> get()reactor.core.publisher.Flux<List<org.springframework.cloud.client.ServiceInstance>> get(org.springframework.cloud.client.loadbalancer.Request request) voidselectedServiceInstance(org.springframework.cloud.client.ServiceInstance serviceInstance) Passes the selectedServiceInstanceas an argument.Methods inherited from class DelegatingServiceInstanceListSupplier
afterPropertiesSet, destroy, getDelegate, getServiceId
-
Constructor Details
-
SameInstancePreferenceServiceInstanceListSupplier
-
SameInstancePreferenceServiceInstanceListSupplier
public SameInstancePreferenceServiceInstanceListSupplier(ServiceInstanceListSupplier delegate, org.springframework.cloud.client.loadbalancer.reactive.ReactiveLoadBalancer.Factory<org.springframework.cloud.client.ServiceInstance> loadBalancerClientFactory)
-
-
Method Details
-
get
-
get
public reactor.core.publisher.Flux<List<org.springframework.cloud.client.ServiceInstance>> get(org.springframework.cloud.client.loadbalancer.Request request) - Specified by:
getin interfaceServiceInstanceListSupplier
-
selectedServiceInstance
public void selectedServiceInstance(org.springframework.cloud.client.ServiceInstance serviceInstance) Description copied from interface:SelectedInstanceCallbackPasses the selectedServiceInstanceas an argument.- Specified by:
selectedServiceInstancein interfaceSelectedInstanceCallback- Overrides:
selectedServiceInstancein classDelegatingServiceInstanceListSupplier- Parameters:
serviceInstance- that has been selected
-