Class RoundRobinConnectionLoadBalancingPolicy
java.lang.Object
org.apache.activemq.artemis.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy
- All Implemented Interfaces:
Serializable
,ConnectionLoadBalancingPolicy
public final class RoundRobinConnectionLoadBalancingPolicy
extends Object
implements ConnectionLoadBalancingPolicy, Serializable
RoundRobinConnectionLoadBalancingPolicy corresponds to a round-robin load-balancing policy.
The first call to
The first call to
select(int)
will return a random integer between 0
(inclusive) and max
(exclusive).
Subsequent calls will then return an integer in a round-robin fashion.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
select
(int max) Returns the selected index according to the policy implementation.
-
Constructor Details
-
RoundRobinConnectionLoadBalancingPolicy
public RoundRobinConnectionLoadBalancingPolicy()
-
-
Method Details
-
select
public int select(int max) Description copied from interface:ConnectionLoadBalancingPolicy
Returns the selected index according to the policy implementation.- Specified by:
select
in interfaceConnectionLoadBalancingPolicy
- Parameters:
max
- maximum position index that can be selected
-