class ClusterSharding extends Extension

Source
ClusterSharding.scala
See also

ClusterSharding companion object

Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClusterSharding
  2. Extension
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ClusterSharding(system: ExtendedActorSystem)

Value Members

  1. def shardRegion(typeName: String): ActorRef

    Retrieve the actor reference of the ShardRegion actor responsible for the named entity type.

    Retrieve the actor reference of the ShardRegion actor responsible for the named entity type. The entity type must be registered with the #start method before it can be used here. Messages to the entity is always sent via the ShardRegion.

  2. def start(typeName: String, entityProps: Props, settings: ClusterShardingSettings, messageExtractor: MessageExtractor): ActorRef

    Java/Scala API: Register a named entity type by defining the akka.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.

    Java/Scala API: Register a named entity type by defining the akka.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.

    The default shard allocation strategy ShardCoordinator.LeastShardAllocationStrategy is used. akka.actor.PoisonPill is used as handOffStopMessage.

    Some settings can be configured as described in the akka.cluster.sharding section of the reference.conf.

    typeName

    the name of the entity type

    entityProps

    the Props of the entity actors that will be created by the ShardRegion

    settings

    configuration settings, see ClusterShardingSettings

    messageExtractor

    functions to extract the entity id, shard id, and the message to send to the entity from the incoming message

    returns

    the actor ref of the ShardRegion that is to be responsible for the shard

  3. def start(typeName: String, entityProps: Props, settings: ClusterShardingSettings, messageExtractor: MessageExtractor, allocationStrategy: ShardAllocationStrategy, handOffStopMessage: Any): ActorRef

    Java/Scala API: Register a named entity type by defining the akka.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.

    Java/Scala API: Register a named entity type by defining the akka.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.

    Some settings can be configured as described in the akka.cluster.sharding section of the reference.conf.

    typeName

    the name of the entity type

    entityProps

    the Props of the entity actors that will be created by the ShardRegion

    settings

    configuration settings, see ClusterShardingSettings

    messageExtractor

    functions to extract the entity id, shard id, and the message to send to the entity from the incoming message, see ShardRegion.MessageExtractor

    allocationStrategy

    possibility to use a custom shard allocation and rebalancing logic

    handOffStopMessage

    the message that will be sent to entities when they are to be stopped for a rebalance or graceful shutdown of a ShardRegion, e.g. PoisonPill.

    returns

    the actor ref of the ShardRegion that is to be responsible for the shard

  4. def start(typeName: String, entityProps: Props, settings: ClusterShardingSettings, extractEntityId: ExtractEntityId, extractShardId: ExtractShardId): ActorRef

    Register a named entity type by defining the akka.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.

    Register a named entity type by defining the akka.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.

    The default shard allocation strategy ShardCoordinator.LeastShardAllocationStrategy is used. akka.actor.PoisonPill is used as handOffStopMessage.

    Some settings can be configured as described in the akka.cluster.sharding section of the reference.conf.

    typeName

    the name of the entity type

    entityProps

    the Props of the entity actors that will be created by the ShardRegion

    settings

    configuration settings, see ClusterShardingSettings

    extractEntityId

    partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be unhandled, i.e. posted as Unhandled messages on the event stream

    extractShardId

    function to determine the shard id for an incoming message, only messages that passed the extractEntityId will be used

    returns

    the actor ref of the ShardRegion that is to be responsible for the shard

  5. def start(typeName: String, entityProps: Props, settings: ClusterShardingSettings, extractEntityId: ExtractEntityId, extractShardId: ExtractShardId, allocationStrategy: ShardAllocationStrategy, handOffStopMessage: Any): ActorRef

    Scala API: Register a named entity type by defining the akka.actor.Props of the entity actor and functions to extract entity and shard identifier from messages.

    Scala API: Register a named entity type by defining the akka.actor.Props of the entity actor and functions to extract entity and shard identifier from messages. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.

    Some settings can be configured as described in the akka.cluster.sharding section of the reference.conf.

    typeName

    the name of the entity type

    entityProps

    the Props of the entity actors that will be created by the ShardRegion

    settings

    configuration settings, see ClusterShardingSettings

    extractEntityId

    partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be unhandled, i.e. posted as Unhandled messages on the event stream

    extractShardId

    function to determine the shard id for an incoming message, only messages that passed the extractEntityId will be used

    allocationStrategy

    possibility to use a custom shard allocation and rebalancing logic

    handOffStopMessage

    the message that will be sent to entities when they are to be stopped for a rebalance or graceful shutdown of a ShardRegion, e.g. PoisonPill.

    returns

    the actor ref of the ShardRegion that is to be responsible for the shard

  6. def startProxy(typeName: String, role: Optional[String], messageExtractor: MessageExtractor): ActorRef

    Java/Scala API: Register a named entity type ShardRegion on this node that will run in proxy only mode, i.e.

    Java/Scala API: Register a named entity type ShardRegion on this node that will run in proxy only mode, i.e. it will delegate messages to other ShardRegion actors on other nodes, but not host any entity actors itself. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.

    Some settings can be configured as described in the akka.cluster.sharding section of the reference.conf.

    typeName

    the name of the entity type

    role

    specifies that this entity type is located on cluster nodes with a specific role. If the role is not specified all nodes in the cluster are used.

    messageExtractor

    functions to extract the entity id, shard id, and the message to send to the entity from the incoming message

    returns

    the actor ref of the ShardRegion that is to be responsible for the shard

  7. def startProxy(typeName: String, role: Option[String], extractEntityId: ExtractEntityId, extractShardId: ExtractShardId): ActorRef

    Scala API: Register a named entity type ShardRegion on this node that will run in proxy only mode, i.e.

    Scala API: Register a named entity type ShardRegion on this node that will run in proxy only mode, i.e. it will delegate messages to other ShardRegion actors on other nodes, but not host any entity actors itself. The ShardRegion actor for this type can later be retrieved with the #shardRegion method.

    Some settings can be configured as described in the akka.cluster.sharding section of the reference.conf.

    typeName

    the name of the entity type

    role

    specifies that this entity type is located on cluster nodes with a specific role. If the role is not specified all nodes in the cluster are used.

    extractEntityId

    partial function to extract the entity id and the message to send to the entity from the incoming message, if the partial function does not match the message will be unhandled, i.e. posted as Unhandled messages on the event stream

    extractShardId

    function to determine the shard id for an incoming message, only messages that passed the extractEntityId will be used

    returns

    the actor ref of the ShardRegion that is to be responsible for the shard