Interface ClusterSharding

  • Type Parameters:
    M - The type of message the entity accepts
    E - A possible envelope around the message the entity accepts
    All Superinterfaces:
    Extension
    All Known Implementing Classes:
    ClusterShardingImpl

    public interface ClusterSharding
    extends Extension
    Initialize sharding for the given entity factory settings.

    It will start a shard region or a proxy depending on if the settings require role and if this node has such a role.

    • Method Detail

      • init

        <M,​E> ActorRef<E> init​(Entity<M,​E> entity)
        Initialize sharding for the given entity factory settings.

        It will start a shard region or a proxy depending on if the settings require role and if this node has such a role.

        Parameters:
        entity - (undocumented)
        Returns:
        (undocumented)
      • entityRefFor

        <M> EntityRef<M> entityRefFor​(EntityTypeKey<M> typeKey,
                                      java.lang.String entityId)
        Create an ActorRef-like reference to a specific sharded entity. Currently you have to correctly specify the type of messages the target can handle.

        Messages sent through this EntityRef will be wrapped in a ShardingEnvelope including the here provided entityId.

        For in-depth documentation of its semantics, see EntityRef.

        Parameters:
        typeKey - (undocumented)
        entityId - (undocumented)
        Returns:
        (undocumented)