akka

routing

package routing

Content Hierarchy Learn more about scaladoc diagrams
Visibility
  1. Public
  2. All

Type Members

  1. case class ActorRefRoutee(ref: ActorRef) extends Routee with Product with Serializable

    Routee that sends the messages to an akka.actor.ActorRef.

  2. case class ActorSelectionRoutee(selection: ActorSelection) extends Routee with Product with Serializable

    Routee that sends the messages to an akka.actor.ActorSelection.

  3. case class AddRoutee(routee: Routee) extends RouterManagementMesssage with Product with Serializable

    Add a routee by sending this message to the router.

    Add a routee by sending this message to the router. It may be handled after other messages.

    Annotations
    @SerialVersionUID()
  4. case class AdjustPoolSize(change: Int) extends RouterManagementMesssage with Product with Serializable

    Increase or decrease the number of routees in a Pool.

    Increase or decrease the number of routees in a Pool. It may be handled after other messages.

    Positive change will add that number of routees to the Pool. Negative change will remove that number of routees from the Pool. Routees are stopped by sending a akka.actor.PoisonPill to the routee. Precautions are taken reduce the risk of dropping messages that are concurrently being routed to the removed routee, but it is not guaranteed that messages are not lost.

    Annotations
    @SerialVersionUID()
  5. final case class BalancingPool(nrOfInstances: Int, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, routerDispatcher: String = Dispatchers.DefaultDispatcherId) extends Pool with Product with Serializable

    A router pool that will try to redistribute work from busy routees to idle routees.

    A router pool that will try to redistribute work from busy routees to idle routees. All routees share the same mailbox.

    Although the technique used in this implementation is commonly known as "work stealing", the actual implementation is probably best described as "work donating" because the actor of which work is being stolen takes the initiative.

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    nrOfInstances

    initial number of routees in the pool

    supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup'

    routerDispatcher

    dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    Annotations
    @SerialVersionUID()
  6. case class Broadcast(message: Any) extends RouterEnvelope with Product with Serializable

    Used to broadcast a message to all routees in a router; only the contained message will be forwarded, i.e.

    Used to broadcast a message to all routees in a router; only the contained message will be forwarded, i.e. the Broadcast(...) envelope will be stripped off.

    Annotations
    @SerialVersionUID()
  7. final case class BroadcastGroup(paths: Iterable[String], routerDispatcher: String = Dispatchers.DefaultDispatcherId) extends Group with Product with Serializable

    A router group that broadcasts a message to all its routees.

    A router group that broadcasts a message to all its routees.

    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.

    paths

    string representation of the actor paths of the routees, messages are sent with akka.actor.ActorSelection to these paths

    routerDispatcher

    dispatcher to use for the router head actor, which handles router management messages

    Annotations
    @SerialVersionUID()
  8. final case class BroadcastPool(nrOfInstances: Int, resizer: Option[Resizer] = None, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, routerDispatcher: String = Dispatchers.DefaultDispatcherId, usePoolDispatcher: Boolean = false) extends Pool with PoolOverrideUnsetConfig[BroadcastPool] with Product with Serializable

    A router pool that broadcasts a message to all its routees.

    A router pool that broadcasts a message to all its routees.

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    nrOfInstances

    initial number of routees in the pool

    resizer

    optional resizer that dynamically adjust the pool size

    supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup'

    routerDispatcher

    dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    Annotations
    @SerialVersionUID()
  9. final class BroadcastRoutingLogic extends RoutingLogic

    Broadcasts a message to all its routees.

    Broadcasts a message to all its routees.

    Annotations
    @SerialVersionUID()
  10. class ConsistentHash[T] extends AnyRef

    Consistent Hashing node ring implementation.

    Consistent Hashing node ring implementation.

    A good explanation of Consistent Hashing: http://weblogs.java.net/blog/tomwhite/archive/2007/11/consistent_hash.html

    Note that toString of the ring nodes are used for the node hash, i.e. make sure it is different for different nodes.

  11. final case class ConsistentHashingGroup(paths: Iterable[String], virtualNodesFactor: Int = 0, hashMapping: ConsistentHashMapping = ..., routerDispatcher: String = Dispatchers.DefaultDispatcherId) extends Group with Product with Serializable

    A router group that uses consistent hashing to select a routee based on the sent message.

    A router group that uses consistent hashing to select a routee based on the sent message. The selection is described in akka.routing.ConsistentHashingRoutingLogic.

    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.

    paths

    string representation of the actor paths of the routees, messages are sent with akka.actor.ActorSelection to these paths

    virtualNodesFactor

    number of virtual nodes per node, used in akka.routing.ConsistentHash

    hashMapping

    partial function from message to the data to use for the consistent hash key

    routerDispatcher

    dispatcher to use for the router head actor, which handles router management messages

    Annotations
    @SerialVersionUID()
  12. final case class ConsistentHashingPool(nrOfInstances: Int, resizer: Option[Resizer] = None, virtualNodesFactor: Int = 0, hashMapping: ConsistentHashMapping = ..., supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, routerDispatcher: String = Dispatchers.DefaultDispatcherId, usePoolDispatcher: Boolean = false) extends Pool with PoolOverrideUnsetConfig[ConsistentHashingPool] with Product with Serializable

    A router pool that uses consistent hashing to select a routee based on the sent message.

    A router pool that uses consistent hashing to select a routee based on the sent message. The selection is described in akka.routing.ConsistentHashingRoutingLogic.

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    nrOfInstances

    initial number of routees in the pool

    resizer

    optional resizer that dynamically adjust the pool size

    virtualNodesFactor

    number of virtual nodes per node, used in akka.routing.ConsistentHash

    hashMapping

    partial function from message to the data to use for the consistent hash key

    supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup'

    routerDispatcher

    dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    Annotations
    @SerialVersionUID()
  13. final case class ConsistentHashingRoutingLogic(system: ActorSystem, virtualNodesFactor: Int = 0, hashMapping: ConsistentHashMapping = ...) extends RoutingLogic with Product with Serializable

    Uses consistent hashing to select a routee based on the sent message.

    Uses consistent hashing to select a routee based on the sent message.

    There is 3 ways to define what data to use for the consistent hash key.

    1. You can define hashMapping / withHashMapper of the router to map incoming messages to their consistent hash key. This makes the decision transparent for the sender.

    2. The messages may implement akka.routing.ConsistentHashingRouter.ConsistentHashable. The key is part of the message and it's convenient to define it together with the message definition.

    3. The messages can be be wrapped in a akka.routing.ConsistentHashingRouter.ConsistentHashableEnvelope to define what data to use for the consistent hash key. The sender knows the key to use.

    These ways to define the consistent hash key can be use together and at the same time for one router. The hashMapping is tried first.

    system

    the actor system hosting this router

    virtualNodesFactor

    number of virtual nodes per node, used in akka.routing.ConsistentHash

    hashMapping

    partial function from message to the data to use for the consistent hash key

    Annotations
    @SerialVersionUID()
  14. abstract class CustomRouterConfig extends RouterConfig

    If a custom router implementation is not a Group nor a Pool it may extend this base class.

  15. case class Deafen(listener: ActorRef) extends ListenerMessage with Product with Serializable

  16. case class DefaultResizer(lowerBound: Int = 1, upperBound: Int = 10, pressureThreshold: Int = 1, rampupRate: Double = 0.2, backoffThreshold: Double = 0.3, backoffRate: Double = 0.1, messagesPerResize: Int = 10) extends Resizer with Product with Serializable

    Implementation of Resizer that adjust the Pool based on specified thresholds.

    Implementation of Resizer that adjust the Pool based on specified thresholds.

    Annotations
    @SerialVersionUID()
  17. class FromConfig extends Pool

    Java API: Router configuration which has no default, i.e.

    Java API: Router configuration which has no default, i.e. external configuration is required.

    This can be used when the dispatcher to be used for the head Router needs to be configured (defaults to default-dispatcher).

    Annotations
    @SerialVersionUID()
  18. abstract class GetRoutees extends RouterManagementMesssage

    Sending this message to a router will make it send back its currently used routees.

    Sending this message to a router will make it send back its currently used routees. A Routees message is sent asynchronously to the "requester" containing information about what routees the router is routing over.

    Annotations
    @SerialVersionUID()
  19. trait Group extends RouterConfig

    RouterConfig for router actor with routee actors that are created external to the router and the router sends messages to the specified path using actor selection, without watching for termination.

  20. abstract class GroupBase extends Group

    Java API: Base class for custom router Group

  21. case class Listen(listener: ActorRef) extends ListenerMessage with Product with Serializable

  22. sealed trait ListenerMessage extends AnyRef

  23. trait Listeners extends AnyRef

    Listeners is a generic trait to implement listening capability on an Actor.

    Listeners is a generic trait to implement listening capability on an Actor.

    Use the gossip(msg) method to have it sent to the listeners.

    Send Listen(self) to start listening.

    Send Deafen(self) to stop listening.

    Send WithListeners(fun) to traverse the current listeners.

  24. abstract class NoRouter extends RouterConfig

    Routing configuration that indicates no routing; this is also the default value which hence overrides the merge strategy in order to accept values from lower-precedence sources.

    Routing configuration that indicates no routing; this is also the default value which hence overrides the merge strategy in order to accept values from lower-precedence sources. The decision whether or not to create a router is taken in the LocalActorRefProvider based on Props.

    Annotations
    @SerialVersionUID()
  25. trait Pool extends RouterConfig

    RouterConfig for router actor that creates routees as child actors and removes them from the router if they terminate.

  26. abstract class PoolBase extends Pool

    Java API: Base class for custom router Pool

  27. final case class RandomGroup(paths: Iterable[String], routerDispatcher: String = Dispatchers.DefaultDispatcherId) extends Group with Product with Serializable

    A router group that randomly selects one of the target routees to send a message to.

    A router group that randomly selects one of the target routees to send a message to.

    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.

    paths

    string representation of the actor paths of the routees, messages are sent with akka.actor.ActorSelection to these paths

    routerDispatcher

    dispatcher to use for the router head actor, which handles router management messages

    Annotations
    @SerialVersionUID()
  28. final case class RandomPool(nrOfInstances: Int, resizer: Option[Resizer] = None, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, routerDispatcher: String = Dispatchers.DefaultDispatcherId, usePoolDispatcher: Boolean = false) extends Pool with PoolOverrideUnsetConfig[RandomPool] with Product with Serializable

    A router pool that randomly selects one of the target routees to send a message to.

    A router pool that randomly selects one of the target routees to send a message to.

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    nrOfInstances

    initial number of routees in the pool

    resizer

    optional resizer that dynamically adjust the pool size

    supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup'

    routerDispatcher

    dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    Annotations
    @SerialVersionUID()
  29. final class RandomRoutingLogic extends RoutingLogic

    Randomly selects one of the target routees to send a message to

    Randomly selects one of the target routees to send a message to

    Annotations
    @SerialVersionUID()
  30. case class RemoveRoutee(routee: Routee) extends RouterManagementMesssage with Product with Serializable

    Remove a specific routee by sending this message to the router.

    Remove a specific routee by sending this message to the router. It may be handled after other messages.

    For a pool, with child routees, the routee is stopped by sending a akka.actor.PoisonPill to the routee. Precautions are taken reduce the risk of dropping messages that are concurrently being routed to the removed routee, but there are no guarantees.

    Annotations
    @SerialVersionUID()
  31. trait Resizer extends AnyRef

    Pool routers with dynamically resizable number of routees are implemented by providing a Resizer implementation in the akka.routing.Pool configuration.

  32. final case class RoundRobinGroup(paths: Iterable[String], routerDispatcher: String = Dispatchers.DefaultDispatcherId) extends Group with Product with Serializable

    A router group that uses round-robin to select a routee.

    A router group that uses round-robin to select a routee. For concurrent calls, round robin is just a best effort.

    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.

    paths

    string representation of the actor paths of the routees, messages are sent with akka.actor.ActorSelection to these paths

    routerDispatcher

    dispatcher to use for the router head actor, which handles router management messages

    Annotations
    @SerialVersionUID()
  33. final case class RoundRobinPool(nrOfInstances: Int, resizer: Option[Resizer] = None, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, routerDispatcher: String = Dispatchers.DefaultDispatcherId, usePoolDispatcher: Boolean = false) extends Pool with PoolOverrideUnsetConfig[RoundRobinPool] with Product with Serializable

    A router pool that uses round-robin to select a routee.

    A router pool that uses round-robin to select a routee. For concurrent calls, round robin is just a best effort.

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    nrOfInstances

    initial number of routees in the pool

    resizer

    optional resizer that dynamically adjust the pool size

    supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup'

    routerDispatcher

    dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    Annotations
    @SerialVersionUID()
  34. final class RoundRobinRoutingLogic extends RoutingLogic

    Uses round-robin to select a routee.

    Uses round-robin to select a routee. For concurrent calls, round robin is just a best effort.

    Annotations
    @SerialVersionUID()
  35. trait Routee extends AnyRef

    Abstraction of a destination for messages routed via a Router.

  36. case class Routees(routees: IndexedSeq[Routee]) extends Product with Serializable

    Message used to carry information about what routees the router is currently using.

    Message used to carry information about what routees the router is currently using.

    Annotations
    @SerialVersionUID()
  37. final case class Router(logic: RoutingLogic, routees: IndexedSeq[Routee] = Vector.empty) extends Product with Serializable

    For each message that is sent through the router via the #route method the RoutingLogic decides to which Routee to send the message.

    For each message that is sent through the router via the #route method the RoutingLogic decides to which Routee to send the message. The Routee itself knows how to perform the actual sending. Normally the RoutingLogic picks one of the contained routees, but that is up to the implementation of the RoutingLogic.

    A Router is immutable and the RoutingLogic must be thread safe.

  38. trait RouterConfig extends Serializable

    This trait represents a router factory: it produces the actual router actor and creates the routing table (a function which determines the recipients for each message which is to be dispatched).

    This trait represents a router factory: it produces the actual router actor and creates the routing table (a function which determines the recipients for each message which is to be dispatched). The resulting RoutedActorRef optimizes the sending of the message so that it does NOT go through the router’s mailbox unless the route returns an empty recipient set.

    Caution: This means that the route function is evaluated concurrently without protection by the RoutedActorRef: either provide a reentrant (i.e. pure) implementation or do the locking yourself!

    Caution: Please note that the akka.routing.Router which needs to be returned by createActor() should not send a message to itself in its constructor or preStart() or publish its self reference from there: if someone tries sending a message to that reference before the constructor of RoutedActorRef has returned, there will be a NullPointerException!

    Annotations
    @SerialVersionUID()
  39. trait RouterEnvelope extends AnyRef

    Only the contained message will be forwarded to the destination, i.e.

    Only the contained message will be forwarded to the destination, i.e. the envelope will be stripped off.

  40. trait RoutingLogic extends NoSerializationVerificationNeeded

    The interface of the routing logic that is used in a Router to select destination routed messages.

    The interface of the routing logic that is used in a Router to select destination routed messages.

    The implementation must be thread safe.

  41. final case class ScatterGatherFirstCompletedGroup(paths: Iterable[String], within: FiniteDuration, routerDispatcher: String = Dispatchers.DefaultDispatcherId) extends Group with Product with Serializable

    A router group that broadcasts the message to all routees, and replies with the first response.

    A router group that broadcasts the message to all routees, and replies with the first response.

    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.

    paths

    string representation of the actor paths of the routees, messages are sent with akka.actor.ActorSelection to these paths

    within

    expecting at least one reply within this duration, otherwise it will reply with akka.pattern.AskTimeoutException in a akka.actor.Status.Failure

    routerDispatcher

    dispatcher to use for the router head actor, which handles router management messages

    Annotations
    @SerialVersionUID()
  42. final case class ScatterGatherFirstCompletedPool(nrOfInstances: Int, resizer: Option[Resizer] = None, within: FiniteDuration, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, routerDispatcher: String = Dispatchers.DefaultDispatcherId, usePoolDispatcher: Boolean = false) extends Pool with PoolOverrideUnsetConfig[ScatterGatherFirstCompletedPool] with Product with Serializable

    A router pool that broadcasts the message to all routees, and replies with the first response.

    A router pool that broadcasts the message to all routees, and replies with the first response.

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    nrOfInstances

    initial number of routees in the pool

    resizer

    optional resizer that dynamically adjust the pool size

    within

    expecting at least one reply within this duration, otherwise it will reply with akka.pattern.AskTimeoutException in a akka.actor.Status.Failure

    supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup'

    routerDispatcher

    dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    Annotations
    @SerialVersionUID()
  43. final case class ScatterGatherFirstCompletedRoutingLogic(within: FiniteDuration) extends RoutingLogic with Product with Serializable

    Broadcasts the message to all routees, and replies with the first response.

    Broadcasts the message to all routees, and replies with the first response.

    within

    expecting at least one reply within this duration, otherwise it will reply with akka.pattern.AskTimeoutException in a akka.actor.Status.Failure

    Annotations
    @SerialVersionUID()
  44. case class SeveralRoutees(routees: IndexedSeq[Routee]) extends Routee with Product with Serializable

    Routee that sends each message to all routees.

  45. final case class SmallestMailboxPool(nrOfInstances: Int, resizer: Option[Resizer] = None, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, routerDispatcher: String = Dispatchers.DefaultDispatcherId, usePoolDispatcher: Boolean = false) extends Pool with PoolOverrideUnsetConfig[SmallestMailboxPool] with Product with Serializable

    A router pool that tries to send to the non-suspended routee with fewest messages in mailbox.

    A router pool that tries to send to the non-suspended routee with fewest messages in mailbox. The selection is done in this order:

    • pick any idle routee (not processing message) with empty mailbox
    • pick any routee with empty mailbox
    • pick routee with fewest pending messages in mailbox
    • pick any remote routee, remote actors are consider lowest priority, since their mailbox size is unknown

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    nrOfInstances

    initial number of routees in the pool

    resizer

    optional resizer that dynamically adjust the pool size

    supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup'

    routerDispatcher

    dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    Annotations
    @SerialVersionUID()
  46. class SmallestMailboxRoutingLogic extends RoutingLogic

    Tries to send to the non-suspended routee with fewest messages in mailbox.

    Tries to send to the non-suspended routee with fewest messages in mailbox. The selection is done in this order:

    • pick any idle routee (not processing message) with empty mailbox
    • pick any routee with empty mailbox
    • pick routee with fewest pending messages in mailbox
    • pick any remote routee, remote actors are consider lowest priority, since their mailbox size is unknown
    Annotations
    @SerialVersionUID()
  47. final case class TailChoppingGroup(paths: Iterable[String], within: FiniteDuration, interval: FiniteDuration, routerDispatcher: String = Dispatchers.DefaultDispatcherId) extends Group with Product with Serializable

    A router group that sends the message to a first, random picked, routee, then wait a specified interval and then send to a second, random picked, and so on till one full cycle..

    A router group that sends the message to a first, random picked, routee, then wait a specified interval and then send to a second, random picked, and so on till one full cycle..

    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.

    paths

    string representation of the actor paths of the routees, messages are sent with akka.actor.ActorSelection to these paths

    within

    expecting at least one reply within this duration, otherwise it will reply with akka.pattern.AskTimeoutException in a akka.actor.Status.Failure

    interval

    duration after which next routee will be picked

    routerDispatcher

    dispatcher to use for the router head actor, which handles router management messages

  48. final case class TailChoppingPool(nrOfInstances: Int, resizer: Option[Resizer] = None, within: FiniteDuration, interval: FiniteDuration, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, routerDispatcher: String = Dispatchers.DefaultDispatcherId, usePoolDispatcher: Boolean = false) extends Pool with PoolOverrideUnsetConfig[TailChoppingPool] with Product with Serializable

    A router poll thats sends the message to a first, random picked, routee, then wait a specified interval and then send to a second, random picked, and so on till one full cycle..

    A router poll thats sends the message to a first, random picked, routee, then wait a specified interval and then send to a second, random picked, and so on till one full cycle..

    The configuration parameter trumps the constructor arguments. This means that if you provide nrOfInstances during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    nrOfInstances

    initial number of routees in the pool

    resizer

    optional resizer that dynamically adjust the pool size

    within

    expecting at least one reply within this duration, otherwise it will reply with akka.pattern.AskTimeoutException in a akka.actor.Status.Failure

    interval

    duration after which next routee will be picked

    supervisorStrategy

    strategy for supervising the routees, see 'Supervision Setup'

    routerDispatcher

    dispatcher to use for the router head actor, which handles supervision, death watch and router management messages

    Annotations
    @SerialVersionUID()
  49. final case class TailChoppingRoutingLogic(scheduler: Scheduler, within: FiniteDuration, interval: FiniteDuration, context: ExecutionContext) extends RoutingLogic with Product with Serializable

    Sends the message to a first, random picked, routee, then wait a specified interval and then send to a second, random picked, and so on till one full cycle.

    Sends the message to a first, random picked, routee, then wait a specified interval and then send to a second, random picked, and so on till one full cycle.

    scheduler

    schedules sending messages to routees

    within

    expecting at least one reply within this duration, otherwise it will reply with akka.pattern.AskTimeoutException in a akka.actor.Status.Failure

    interval

    duration after which next routee will be picked

    context

    execution context used by scheduler

    Annotations
    @SerialVersionUID()
  50. case class WithListeners(f: (ActorRef) ⇒ Unit) extends ListenerMessage with Product with Serializable

  51. case class BroadcastRouter(nrOfInstances: Int = 0, routees: Iterable[String] = Nil, resizer: Option[Resizer] = None, routerDispatcher: String = Dispatchers.DefaultDispatcherId, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[BroadcastRouter] with Product with Serializable

    A Router that uses broadcasts a message to all its connections.

    A Router that uses broadcasts a message to all its connections.
    Please note that providing both 'nrOfInstances' and 'routees' does not make logical sense as this means that the router should both create new actors and use the 'routees' actor(s). In this case the 'nrOfInstances' will be ignored and the 'routees' will be used.
    The configuration parameter trumps the constructor arguments. This means that if you provide either 'nrOfInstances' or 'routees' during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    routees

    string representation of the actor paths of the routees that will be looked up using actorFor in akka.actor.ActorRefProvider

    Annotations
    @SerialVersionUID() @deprecated
    Deprecated

    (Since version 2.3) Use BroadcastPool or BroadcastGroup

  52. case class ConsistentHashingRouter(nrOfInstances: Int = 0, routees: Iterable[String] = Nil, resizer: Option[Resizer] = None, routerDispatcher: String = Dispatchers.DefaultDispatcherId, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy, virtualNodesFactor: Int = 0, hashMapping: ConsistentHashMapping = ...) extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[ConsistentHashingRouter] with Product with Serializable

    A Router that uses consistent hashing to select a connection based on the sent message.

    A Router that uses consistent hashing to select a connection based on the sent message.

    There is 3 ways to define what data to use for the consistent hash key.

    1. You can define hashMapping / withHashMapper of the router to map incoming messages to their consistent hash key. This makes the decision transparent for the sender.

    2. The messages may implement akka.routing.ConsistentHashingRouter.ConsistentHashable. The key is part of the message and it's convenient to define it together with the message definition.

    3. The messages can be be wrapped in a akka.routing.ConsistentHashingRouter.ConsistentHashableEnvelope to define what data to use for the consistent hash key. The sender knows the key to use.

    These ways to define the consistent hash key can be use together and at the same time for one router. The hashMapping is tried first.

    Please note that providing both 'nrOfInstances' and 'routees' does not make logical sense as this means that the router should both create new actors and use the 'routees' actor(s). In this case the 'nrOfInstances' will be ignored and the 'routees' will be used.
    The configuration parameter trumps the constructor arguments. This means that if you provide either 'nrOfInstances' or 'routees' during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    routees

    string representation of the actor paths of the routees that will be looked up using actorFor in akka.actor.ActorRefProvider

    virtualNodesFactor

    number of virtual nodes per node, used in akka.routing.ConsistentHash

    hashMapping

    partial function from message to the data to use for the consistent hash key

    Annotations
    @SerialVersionUID() @deprecated
    Deprecated

    (Since version 2.3) Use ConsistentHashingPool or ConsistentHashingGroup

  53. abstract class CurrentRoutees extends RouterManagementMesssage

    Sending this message to a router will make it send back its currently used routees.

    Sending this message to a router will make it send back its currently used routees. A RouterRoutees message is sent asynchronously to the "requester" containing information about what routees the router is routing over.

    Annotations
    @deprecated @SerialVersionUID()
    Deprecated

    (Since version 2.3) Use GetRoutees

  54. trait DeprecatedRouterConfig extends Group with Pool

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3) Use Pool or Group

  55. case class RandomRouter(nrOfInstances: Int = 0, routees: Iterable[String] = Nil, resizer: Option[Resizer] = None, routerDispatcher: String = Dispatchers.DefaultDispatcherId, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[RandomRouter] with Product with Serializable

    A Router that randomly selects one of the target connections to send a message to.

    A Router that randomly selects one of the target connections to send a message to.
    Please note that providing both 'nrOfInstances' and 'routees' does not make logical sense as this means that the router should both create new actors and use the 'routees' actor(s). In this case the 'nrOfInstances' will be ignored and the 'routees' will be used.
    The configuration parameter trumps the constructor arguments. This means that if you provide either 'nrOfInstances' or 'routees' during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    routees

    string representation of the actor paths of the routees that will be looked up using actorFor in akka.actor.ActorRefProvider

    Annotations
    @SerialVersionUID() @deprecated
    Deprecated

    (Since version 2.3) Use RandomPool or RandomGroup

  56. case class RoundRobinRouter(nrOfInstances: Int = 0, routees: Iterable[String] = Nil, resizer: Option[Resizer] = None, routerDispatcher: String = Dispatchers.DefaultDispatcherId, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[RoundRobinRouter] with Product with Serializable

    A Router that uses round-robin to select a connection.

    A Router that uses round-robin to select a connection. For concurrent calls, round robin is just a best effort.
    Please note that providing both 'nrOfInstances' and 'routees' does not make logical sense as this means that the router should both create new actors and use the 'routees' actor(s). In this case the 'nrOfInstances' will be ignored and the 'routees' will be used.
    The configuration parameter trumps the constructor arguments. This means that if you provide either 'nrOfInstances' or 'routees' during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    routees

    string representation of the actor paths of the routees that will be looked up using actorFor in akka.actor.ActorRefProvider

    Annotations
    @SerialVersionUID() @deprecated
    Deprecated

    (Since version 2.3) Use RoundRobinPool or RoundRobinGroup

  57. case class RouterRoutees(routees: IndexedSeq[ActorRef]) extends Product with Serializable

    Message used to carry information about what routees the router is currently using.

    Message used to carry information about what routees the router is currently using.

    Annotations
    @deprecated @SerialVersionUID()
    Deprecated

    (Since version 2.3) Use GetRoutees

  58. case class ScatterGatherFirstCompletedRouter(nrOfInstances: Int = 0, routees: Iterable[String] = Nil, within: FiniteDuration, resizer: Option[Resizer] = None, routerDispatcher: String = Dispatchers.DefaultDispatcherId, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[ScatterGatherFirstCompletedRouter] with Product with Serializable

    Simple router that broadcasts the message to all routees, and replies with the first response.

    Simple router that broadcasts the message to all routees, and replies with the first response.
    You have to defin the 'within: Duration' parameter (f.e: within = 10 seconds).
    Please note that providing both 'nrOfInstances' and 'routees' does not make logical sense as this means that the router should both create new actors and use the 'routees' actor(s). In this case the 'nrOfInstances' will be ignored and the 'routees' will be used.
    The configuration parameter trumps the constructor arguments. This means that if you provide either 'nrOfInstances' or 'routees' during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    routees

    string representation of the actor paths of the routees that will be looked up using actorFor in akka.actor.ActorRefProvider

    Annotations
    @SerialVersionUID() @deprecated
    Deprecated

    (Since version 2.3) Use ScatterGatherFirstCompletedPool or ScatterGatherFirstCompletedGroup

  59. case class SmallestMailboxRouter(nrOfInstances: Int = 0, routees: Iterable[String] = Nil, resizer: Option[Resizer] = None, routerDispatcher: String = Dispatchers.DefaultDispatcherId, supervisorStrategy: SupervisorStrategy = Pool.defaultSupervisorStrategy) extends DeprecatedRouterConfig with PoolOverrideUnsetConfig[SmallestMailboxRouter] with Product with Serializable

    A Router that tries to send to the non-suspended routee with fewest messages in mailbox.

    A Router that tries to send to the non-suspended routee with fewest messages in mailbox. The selection is done in this order:

    • pick any idle routee (not processing message) with empty mailbox
    • pick any routee with empty mailbox
    • pick routee with fewest pending messages in mailbox
    • pick any remote routee, remote actors are consider lowest priority, since their mailbox size is unknown


    Please note that providing both 'nrOfInstances' and 'routees' does not make logical sense as this means that the router should both create new actors and use the 'routees' actor(s). In this case the 'nrOfInstances' will be ignored and the 'routees' will be used.
    The configuration parameter trumps the constructor arguments. This means that if you provide either 'nrOfInstances' or 'routees' during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.

    Supervision Setup

    Any routees that are created by a router will be created as the router's children. The router is therefore also the children's supervisor.

    The supervision strategy of the router actor can be configured with #withSupervisorStrategy. If no strategy is provided, routers default to a strategy of “always escalate”. This means that errors are passed up to the router's supervisor for handling.

    The router's supervisor will treat the error as an error with the router itself. Therefore a directive to stop or restart will cause the router itself to stop or restart. The router, in turn, will cause its children to stop and restart.

    routees

    string representation of the actor paths of the routees that will be looked up using actorFor in akka.actor.ActorRefProvider

    Annotations
    @SerialVersionUID() @deprecated
    Deprecated

    (Since version 2.3) Use SmallestMailboxPool

Value Members

  1. object BroadcastRoutingLogic

  2. object ConsistentHash

  3. object ConsistentHashingRouter extends Serializable

  4. object ConsistentHashingRoutingLogic extends Serializable

  5. object DefaultResizer extends Product with Serializable

  6. object FromConfig extends FromConfig with Product with Serializable

    Router configuration which has no default, i.e.

    Router configuration which has no default, i.e. external configuration is required.

  7. object GetRoutees extends GetRoutees with Product with Serializable

    Annotations
    @SerialVersionUID()
  8. object MurmurHash

    An object designed to generate well-distributed non-cryptographic hashes.

    An object designed to generate well-distributed non-cryptographic hashes. It is designed to hash a collection of integers; along with the integers to hash, it generates two magic streams of integers to increase the distribution of repetitive input sequences. Thus, three methods need to be called at each step (to start and to incorporate a new integer) to update the values. Only one method needs to be called to finalize the hash.

  9. object NoRoutee extends Routee

    Routee that doesn't send the message to any routee.

    Routee that doesn't send the message to any routee. The Router will send the message to deadLetters if NoRoutee is returned from RoutingLogic#select

  10. object NoRouter extends NoRouter with Product with Serializable

  11. object Pool extends Serializable

  12. object RandomRoutingLogic

  13. object RoundRobinRoutingLogic

  14. object SmallestMailboxRoutingLogic

Deprecated Value Members

  1. object BroadcastRouter extends Serializable

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3) Use BroadcastPool or BroadcastGroup

  2. object CurrentRoutees extends CurrentRoutees with Product with Serializable

    Annotations
    @deprecated @SerialVersionUID()
    Deprecated

    (Since version 2.3) Use GetRoutees

  3. object RandomRouter extends Serializable

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3) Use RandomPool or RandomGroup

  4. object RoundRobinRouter extends Serializable

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3) Use RoundRobinPool or RoundRobinGroup

  5. object ScatterGatherFirstCompletedRouter extends Serializable

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3) Use ScatterGatherFirstCompletedPool or ScatterGatherFirstCompletedGroup

  6. object SmallestMailboxRouter extends Serializable

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3) Use SmallestMailboxPool

Ungrouped