Class AdaptiveLoadBalancingGroup
A router group that performs 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.
The configuration parameter trumps the constructor arguments. This means that
if you provide paths during instantiation they will be ignored if
the router is defined in the configuration file for the actor being used.
Inherited Members
Namespace: Akka.Cluster.Metrics
Assembly: Akka.Cluster.Metrics.dll
Syntax
public sealed class AdaptiveLoadBalancingGroup : Group, ISurrogated, IEquatable<RouterConfig>, IEquatable<Group>
Constructors
| Edit this page View SourceAdaptiveLoadBalancingGroup(IMetricsSelector, IEnumerable<string>, string)
Creates new instance of AdaptiveLoadBalancingGroup from provided configuration
Declaration
public AdaptiveLoadBalancingGroup(IMetricsSelector metricsSelector = null, IEnumerable<string> paths = null, string routerDispatcher = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IMetricsSelector | metricsSelector | Decides what probability to use for selecting a routee, based on remaining capacity as indicated by the node metrics |
| IEnumerable<string> | paths | String representation of the actor paths of the routees, messages are sent with ActorSelection to these paths |
| string | routerDispatcher | Dispatcher to use for the router head actor, which handles router management messages |
AdaptiveLoadBalancingGroup(Config)
Creates new instance of AdaptiveLoadBalancingGroup from provided configuration
Declaration
public AdaptiveLoadBalancingGroup(Config config)
Parameters
| Type | Name | Description |
|---|---|---|
| Config | config |
Methods
| Edit this page View SourceCreateRouter(ActorSystem)
Creates a router that is responsible for routing messages to routees within the provided system.
Declaration
public override Router CreateRouter(ActorSystem system)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorSystem | system | The ActorSystem this router belongs to. |
Returns
| Type | Description |
|---|---|
| Router | The newly created router tied to the given system. |
Overrides
| Edit this page View SourceGetPaths(ActorSystem)
Retrieves the actor paths used by this router during routee selection.
Declaration
public override IEnumerable<string> GetPaths(ActorSystem system)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorSystem | system | The actor system that owns this router. |
Returns
| Type | Description |
|---|---|
| IEnumerable<string> | An enumeration of actor paths used during routee selection |
Overrides
| Edit this page View SourceRoutingLogicController(RoutingLogic)
Possibility to define an actor for controlling the routing logic from external stimuli(e.g.monitoring metrics). This actor will be a child of the router "head" actor. Management messages not handled by the "head" actor are delegated to this controller actor.
Declaration
public override Props RoutingLogicController(RoutingLogic routingLogic)
Parameters
| Type | Name | Description |
|---|---|---|
| RoutingLogic | routingLogic |
Returns
| Type | Description |
|---|---|
| Props |
Overrides
| Edit this page View SourceToSurrogate(ActorSystem)
Creates a surrogate representation of the current router.
Declaration
public override ISurrogate ToSurrogate(ActorSystem system)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorSystem | system | The actor system that owns this router. |
Returns
| Type | Description |
|---|---|
| ISurrogate | The surrogate representation of the current router. |
Overrides
| Edit this page View SourceWithDispatcher(string)
Setting the dispatcher to be used for the router head actor, which handles router management messages
Declaration
public AdaptiveLoadBalancingGroup WithDispatcher(string dispatcherId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | dispatcherId |
Returns
| Type | Description |
|---|---|
| AdaptiveLoadBalancingGroup |
Edit this page