Package akka.javasdk.keyvalueentity
Interface CommandContext
- All Superinterfaces:
Context,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 TypeMethodDescriptionReturns the name of the command currently being executed.entityId()Returns the unique identifier of the entity instance that this command is being executed on.tracing()Provides access to tracing functionality for adding custom application-specific tracing information to the current command processing.Methods inherited from interface akka.javasdk.Context
selfRegionMethods 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
-
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
-