pub struct LoadBalancerBuilder { /* private fields */ }Expand description
Builder for the sub-pipeline within a .load_balance() … .end_load_balance() block.
Exposes the same step methods as RouteBuilder (to, process, filter, etc.)
but NOT .build() and NOT .load_balance() (no nested load balancers).
Calling .end_load_balance() packages the sub-steps into a BuilderStep::LoadBalance
and returns the parent RouteBuilder.
Implementations§
Source§impl LoadBalancerBuilder
impl LoadBalancerBuilder
Sourcepub fn round_robin(self) -> Self
pub fn round_robin(self) -> Self
Set the load balance strategy to round-robin (default).
Sourcepub fn weighted(self, weights: Vec<(String, u32)>) -> Self
pub fn weighted(self, weights: Vec<(String, u32)>) -> Self
Set the load balance strategy to weighted selection.
Each endpoint is assigned a weight that determines its probability of being selected.
Sourcepub fn failover(self) -> Self
pub fn failover(self) -> Self
Set the load balance strategy to failover.
Exchanges are sent to the first endpoint; on failure, the next endpoint is tried.
Sourcepub fn parallel(self, parallel: bool) -> Self
pub fn parallel(self, parallel: bool) -> Self
Enable or disable parallel execution of endpoints.
When enabled, all endpoints receive the exchange simultaneously. When disabled (default), only one endpoint is selected per exchange.
Sourcepub fn end_load_balance(self) -> RouteBuilder
pub fn end_load_balance(self) -> RouteBuilder
Close the load balance scope. Packages the accumulated sub-steps into a
BuilderStep::LoadBalance and returns the parent RouteBuilder.