A
- a representation of an action command that is shared across all actions in the saga. This is typically a generic type, such as Json, or if using Avro serialization, SpecificRecord or GenericRecordpublic class ActionResponse<A> extends Object
ActionResponse
in the action response topic.
The saga coordinator consumes this response and updates the action and saga state as appropriate.
The action request and response is essentially the interface between the saga coordinator and the action processor. Although the saga coordinator and action processor can be hosted in
different processes, they must share the same A
type, and also must have Serdes that are compatible with each other.
Modifier and Type | Field and Description |
---|---|
ActionId |
actionId
The action id uniquely identifies an action in the saga dependency graph.
|
io.simplesource.api.CommandId |
commandId
The
command id is the unique identifier for an action command execution. |
Boolean |
isUndo
Indicates whether or not this action is processing in undo (compensation) mode.
|
io.simplesource.data.Result<SagaError,Optional<UndoCommand<A>>> |
result
The result, consisting of a
SagaError if processing fail and indicating success if processing succeeds. |
SagaId |
sagaId
The saga id uniquely identifies the saga, and is used as the key for the action request and responses.
|
Constructor and Description |
---|
ActionResponse() |
public final SagaId sagaId
public final ActionId actionId
public final io.simplesource.api.CommandId commandId
command id
is the unique identifier for an action command execution.public final Boolean isUndo
public final io.simplesource.data.Result<SagaError,Optional<UndoCommand<A>>> result
SagaError
if processing fail and indicating success if processing succeeds.
The action processor can optionally return an undo command for a non-undo action that processes successfully. If set, this replaces any undo command that may already be defined in the dependency graph.
Copyright © 2019. All rights reserved.