Interface CommandContext

All Superinterfaces:
Context, MetadataContext

public interface CommandContext extends MetadataContext
Context information available to Key Value Entity command handlers during command processing. Provides access to command metadata, entity identification, and tracing capabilities.

This context is automatically provided by the Akka runtime and can be accessed within command handlers using KeyValueEntity.commandContext().

  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Deprecated.
    This method is no longer used and will be removed in a future version
    Returns the name of the command currently being executed.
    Returns the unique identifier of the entity instance that this command is being executed on.
    Provides access to tracing functionality for adding custom application-specific tracing information to the current command processing.

    Methods inherited from interface akka.javasdk.Context

    selfRegion

    Methods inherited from interface akka.javasdk.MetadataContext

    metadata
  • Method Details

    • commandName

      String commandName()
      Returns the name of the command currently being executed. This corresponds to the method name of the command handler being invoked.
      Returns:
      the name of the command being processed
    • commandId

      @Deprecated long commandId()
      Deprecated.
      This method is no longer used and will be removed in a future version
      Returns the command id for the current command.
      Returns:
      the command id
    • entityId

      String entityId()
      Returns the unique identifier of the entity instance that this command is being executed on. This is the same id used when calling the entity through a component client.
      Returns:
      the unique entity id for this entity instance
    • tracing

      Tracing tracing()
      Provides access to tracing functionality for adding custom application-specific tracing information to the current command processing.
      Returns:
      the tracing context for custom tracing operations