Random

Random mode for the Load Balancer EIP.

The destination endpoints are selected randomly. This is a well-known and classic policy, which spreads the load randomly.

The Random eip has no options.

Example

We want to load balance between three endpoints in random mode.

This is done as follows:

  • Java

  • XML

from("direct:start")
    .loadBalance().random()
        .to("seda:x")
        .to("seda:y")
        .to("seda:z")
    .end();
<route>
    <from uri="direct:start"/>
    <loadBalance>
       <random/>
       <to uri="seda:x"/>
       <to uri="seda:y"/>
       <to uri="seda:z"/>
    </loadBalance>
</route>