org.apache.activemq.artemis.api.core.client.loadbalance

## Class RandomConnectionLoadBalancingPolicy

- java.lang.Object
- - org.apache.activemq.artemis.api.core.client.loadbalance.RandomConnectionLoadBalancingPolicy

- All Implemented Interfaces:
    ConnectionLoadBalancingPolicy

      public final class RandomConnectionLoadBalancingPolicy
      extends Object
      implements ConnectionLoadBalancingPolicy

  `select(int)` returns a (pseudo) random integer between `0` (inclusive) and `max` (exclusive).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RandomConnectionLoadBalancingPolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `select(int max)` Returns a pseudo random number between `0` (inclusive) and `max` exclusive.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RandomConnectionLoadBalancingPolicy

          public RandomConnectionLoadBalancingPolicy()

  - ### Method Detail

    - #### select

          public int select(int max)

      Returns a pseudo random number between `0` (inclusive) and `max` exclusive.
      Specified by:
        `select` in interface `ConnectionLoadBalancingPolicy`
      Parameters:
        `max` - the upper limit of the random number selection
      See Also:
        `Random.nextInt(int)`

Copyright © 2016. All rights reserved.