Interface EventContext

All Superinterfaces:
Context, EntityContext, EventSourcedEntityContext

public interface EventContext extends EventSourcedEntityContext
Context information available when processing events in the EventSourcedEntity.applyEvent(E) method. Provides access to event metadata and sequence information.

This context is automatically provided by the Akka runtime and can be accessed within the EventSourcedEntity.applyEvent(E) method using EventSourcedEntity.eventContext().

  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the sequence number of the current event being processed.

    Methods inherited from interface akka.javasdk.Context

    selfRegion

    Methods inherited from interface akka.javasdk.EntityContext

    entityId
  • Method Details

    • sequenceNumber

      long sequenceNumber()
      Returns the sequence number of the current event being processed. This represents the position of this event in the entity's event journal.
      Returns:
      the sequence number of the current event