Add flexibility to zone preference in load balancing (#1174)
This commit is contained in:
committed by
Olga Maciaszek-Sharma
parent
987704784f
commit
c13c8bbb5b
@@ -198,6 +198,21 @@ public final class ServiceInstanceListSupplierBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a {@link ZonePreferenceServiceInstanceListSupplier} to the
|
||||
* {@link ServiceInstanceListSupplier} hierarchy.
|
||||
* @param zoneName desired zone for zone preference
|
||||
* @return the {@link ServiceInstanceListSupplierBuilder} object
|
||||
*/
|
||||
public ServiceInstanceListSupplierBuilder withZonePreference(String zoneName) {
|
||||
DelegateCreator creator = (context, delegate) -> {
|
||||
LoadBalancerZoneConfig zoneConfig = new LoadBalancerZoneConfig(zoneName);
|
||||
return new ZonePreferenceServiceInstanceListSupplier(delegate, zoneConfig);
|
||||
};
|
||||
this.creators.add(creator);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a {@link RequestBasedStickySessionServiceInstanceListSupplier} to the
|
||||
* {@link ServiceInstanceListSupplier} hierarchy.
|
||||
|
||||
Reference in New Issue
Block a user