Class CommandProcessorImpl<T extends UnifiedRecordValue>
java.lang.Object
io.camunda.zeebe.engine.processing.streamprocessor.CommandProcessorImpl<T>
- Type Parameters:
T- the record value type
- All Implemented Interfaces:
CommandProcessor.CommandControl<T>,TypedRecordProcessor<T>
public final class CommandProcessorImpl<T extends UnifiedRecordValue>
extends Object
implements TypedRecordProcessor<T>, CommandProcessor.CommandControl<T>
Decorates a command processor with simple accept and reject logic.
On accept it writes the state corresponding to successfully processing the command (e.g. process instance creation: CREATE => CREATED); and responds if it was a client command that should be responded to.
On reject it writes a command rejection
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.engine.processing.streamprocessor.TypedRecordProcessor
TypedRecordProcessor.ProcessingError -
Constructor Summary
ConstructorsConstructorDescriptionCommandProcessorImpl(CommandProcessor<T> commandProcessor, KeyGenerator keyGenerator, Writers writers) -
Method Summary
Modifier and TypeMethodDescriptionlongvoidprocessRecord(TypedRecord<T> command) voidreject(RejectionType type, String reason) tryHandleError(TypedRecord<T> command, Throwable error) Try to handle an error that occurred during processing.
-
Constructor Details
-
CommandProcessorImpl
public CommandProcessorImpl(CommandProcessor<T> commandProcessor, KeyGenerator keyGenerator, Writers writers)
-
-
Method Details
-
processRecord
- Specified by:
processRecordin interfaceTypedRecordProcessor<T extends UnifiedRecordValue>
-
tryHandleError
Description copied from interface:TypedRecordProcessorTry to handle an error that occurred during processing.- Specified by:
tryHandleErrorin interfaceTypedRecordProcessor<T extends UnifiedRecordValue>- Parameters:
command- The command that was being processed when the error occurrederror- The error that occurred, and the processor should attempt to handle- Returns:
- The type of the processing error. Default:
TypedRecordProcessor.ProcessingError.UNEXPECTED_ERROR.
-
accept
- Specified by:
acceptin interfaceCommandProcessor.CommandControl<T extends UnifiedRecordValue>- Returns:
- the key of the entity
-
reject
- Specified by:
rejectin interfaceCommandProcessor.CommandControl<T extends UnifiedRecordValue>
-