Class AdaptiveLoadBalancingRoutingLogic
Load balancing of messages to cluster nodes based on cluster metric data.
It uses random selection of routees based on probabilities derived from the remaining capacity of corresponding node.
Inherited Members
Namespace: Akka.Cluster.Metrics
Assembly: Akka.Cluster.Metrics.dll
Syntax
public sealed class AdaptiveLoadBalancingRoutingLogic : RoutingLogic, INoSerializationVerificationNeeded, IClusterMetricsRoutingLogic
Constructors
| Improve this Doc View SourceAdaptiveLoadBalancingRoutingLogic(ActorSystem, IMetricsSelector)
Creates instance if AdaptiveLoadBalancingRoutingLogic
Declaration
public AdaptiveLoadBalancingRoutingLogic(ActorSystem system, IMetricsSelector metricsSelector = null)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The actor system hosting this router |
IMetricsSelector | metricsSelector | Decides what probability to use for selecting a routee, based on remaining capacity as indicated by the node metrics |
Methods
| Improve this Doc View SourceMetricsChanged(ClusterMetricsChanged)
Declaration
public void MetricsChanged(ClusterMetricsChanged event)
Parameters
Type | Name | Description |
---|---|---|
ClusterMetricsChanged | event |
Select(Object, Routee[])
Picks a Routee to receive the message
.
note
Normally it picks one of the passed routees, but it is up to the implementation to return whatever Routee to use for sending a specific message.
Declaration
public override Routee Select(object message, Routee[] routees)
Parameters
Type | Name | Description |
---|---|---|
Object | message | The message that is being routed |
Routee[] | routees | A collection of routees to choose from when receiving the |
Returns
Type | Description |
---|---|
Routee | A Routee that receives the |