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
| Improve this Doc 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
| Improve this Doc 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
| Improve this Doc 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
| Improve this Doc 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
| Improve this Doc 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
| Improve this Doc 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 |