Enum Class HttpTrafficPolicy.LoadBalancingStrategy
- All Implemented Interfaces:
Serializable
,Comparable<HttpTrafficPolicy.LoadBalancingStrategy>
,Constable
- Enclosing class:
HttpTrafficPolicy
Load balancing strategies supported in HTTP services.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionLeast request load balancing strategy where service instances are selected based on their active requests count.Minimum load factor load balancing strategy where service instances are selected based on their load factor.Random load balancing strategy where service instances are randomly selected.Round-robin load balancing strategy where service instances are selected in sequence. -
Method Summary
Modifier and TypeMethodDescriptionReturns the default load balancer factory for the strategy.boolean
Determines whether the strategy supports unmanageable destination services.Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RANDOM
Random load balancing strategy where service instances are randomly selected.
- See Also:
-
ROUND_ROBIN
Round-robin load balancing strategy where service instances are selected in sequence.
- See Also:
-
LEAST_REQUEST
Least request load balancing strategy where service instances are selected based on their active requests count.
- See Also:
-
MIN_LOAD_FACTOR
Minimum load factor load balancing strategy where service instances are selected based on their load factor.
- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getDefaultLoadBalancerFactory
public TrafficLoadBalancer.Factory<HttpServiceInstance,UnboundExchange<?>> getDefaultLoadBalancerFactory()Returns the default load balancer factory for the strategy.
- Returns:
- a load balancer factory or null
-
isSupportUnmanageable
public boolean isSupportUnmanageable()Determines whether the strategy supports unmanageable destination services.
A manageable destination service implements
ManageableService
and exposes its underlying service instances to an HTTP meta service which can then directly manage service instances from multiple destinations and load balance traffic among them within a route. An unmanageable destination service, on the other hand, is opaque and doesn't expose its service instances which limits the choice of load balancing strategies to those that don't require direct access to service instances (e.g. active requests, load factor...).- Returns:
- true if unmanageable services are supported, false otherwise
-