Package kalix.javasdk.action
Class Action
Object
kalix.javasdk.action.Action
Actions are stateless components that can be used to implement different uses cases, such as:
- a pure function.
- request conversion - you can use Actions to convert incoming data into a different. format before forwarding a call to a different component.
- as a face or controller to fan out to multiple calls to different components.
- publish messages to a Topic.
- subscribe to events from an Event Sourced Entity.
- subscribe to state changes from a Value Entity.
- schedule and cancel Timers.
Actions can be triggered in multiple ways. For example, by:
- a gRPC service call.
- an HTTP service call.
- a forwarded call from another component.
- a scheduled call from a Timer.
- an incoming message from a Topic.
- an incoming event from an Event Sourced Entity, from within the same service or from a different service.
- state changes notification from a Value Entity on the same service.
Action.Effect
that describes what to do next.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
An Effect is a description of what Kalix needs to do after the command is handled. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
_internalSetActionContext
(Optional<ActionContext> context) INTERNAL APIprotected final ActionContext
Additional context and metadata for a message handler.protected final ActionContext
INTERNAL APIfinal Action.Effect.Builder
effects()
final TimerScheduler
timers()
Returns aTimerScheduler
that can be used to schedule further in time.
-
Constructor Details
-
Action
public Action()
-
-
Method Details
-
actionContext
Additional context and metadata for a message handler.It will throw an exception if accessed from constructor.
-
contextForComponents
INTERNAL APISame as actionContext, but if specific error message when accessing components.
-
_internalSetActionContext
INTERNAL API -
effects
-
timers
Returns aTimerScheduler
that can be used to schedule further in time.
-