Random Load Balancer
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 Load Balancer eip supports the following options which are listed below.
| Name | Description | Default | Type |
|---|
Example
We want to load balance between three endpoints in random mode.
This is done as follows:
-
Java
-
XML
-
YAML
from("direct:start")
.loadBalance().random()
.to("seda:x")
.to("seda:y")
.to("seda:z")
.end(); <route>
<from uri="direct:start"/>
<loadBalance>
<randomLoadBalancer/>
<to uri="seda:x"/>
<to uri="seda:y"/>
<to uri="seda:z"/>
</loadBalance>
</route> - route:
from:
uri: direct:start
steps:
- loadBalance:
steps:
- randomLoadBalancer: {}
- to:
uri: seda:x
- to:
uri: seda:y
- to:
uri: seda:z