Class EntityContext<M>

java.lang.Object
org.apache.pekko.cluster.sharding.typed.javadsl.EntityContext<M>

public final class EntityContext<M> extends Object
Parameter to createBehavior function in Entity.of.

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


 PersistenceId.of(entityContext.getEntityTypeKey().name(), entityContext.getEntityId())
 

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