final class EntityContext[M] extends AnyRef

Parameter to createBehavior function in Entity.of.

Cluster Sharding is often used together with akka.persistence.typed.javadsl.EventSourcedBehavior for the entities. See more considerations in akka.persistence.typed.PersistenceId. The PersistenceId of the EventSourcedBehavior can typically be constructed with:

PersistenceId.of(entityContext.getEntityTypeKey().name(), entityContext.getEntityId())
Source
ClusterSharding.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EntityContext
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new EntityContext(entityTypeKey: EntityTypeKey[M], entityId: String, shard: [ShardCommand])

    entityTypeKey

    the key of the entity type

    entityId

    the business domain identifier of the entity

Value Members

  1. def getEntityId: String
  2. def getEntityTypeKey: EntityTypeKey[M]
  3. def getShard: [ShardCommand]