Class EntityContext<M>


  • public final class EntityContext<M>
    extends java.lang.Object
    Parameter to createBehavior function in Entity.apply.

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

    
     PersistenceId(entityContext.entityTypeKey.name, entityContext.entityId)
     

    param: entityTypeKey the key of the entity type param: entityId the business domain identifier of the entity