Package org.camunda.bpm.engine.impl.cmd
Class FetchExternalTasksCmd
java.lang.Object
org.camunda.bpm.engine.impl.cmd.FetchExternalTasksCmd
- All Implemented Interfaces:
- Command<List<LockedExternalTask>>
- Author:
- Thorben Lindhauer, Christopher Zell
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Map<String,TopicFetchInstruction> protected static final EnginePersistenceLoggerprotected intprotected booleanprotected String
- 
Constructor SummaryConstructorsConstructorDescriptionFetchExternalTasksCmd(String workerId, int maxResults, Map<String, TopicFetchInstruction> instructions) FetchExternalTasksCmd(String workerId, int maxResults, Map<String, TopicFetchInstruction> instructions, boolean usePriority) 
- 
Method SummaryModifier and TypeMethodDescriptionexecute(CommandContext commandContext) protected voidfilterOnOptimisticLockingFailure(CommandContext commandContext, List<LockedExternalTask> tasks) booleanWhen CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted.protected void
- 
Field Details- 
LOG
- 
workerId
- 
maxResultsprotected int maxResults
- 
usePriorityprotected boolean usePriority
- 
fetchInstructions
 
- 
- 
Constructor Details- 
FetchExternalTasksCmdpublic FetchExternalTasksCmd(String workerId, int maxResults, Map<String, TopicFetchInstruction> instructions) 
- 
FetchExternalTasksCmdpublic FetchExternalTasksCmd(String workerId, int maxResults, Map<String, TopicFetchInstruction> instructions, boolean usePriority) 
 
- 
- 
Method Details- 
execute- Specified by:
- executein interface- Command<List<LockedExternalTask>>
 
- 
isRetryablepublic boolean isRetryable()When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted. CockroachDB uses a stricter, SERIALIZABLE transaction isolation which ensures a serialized manner of transaction execution. A concurrent transaction that attempts to modify the same data as another transaction is required to abort, rollback and retry. This also makes our use-case of pessimistic locks redundant since we only use them as synchronization barriers, and not to lock actual data which would protect it from concurrent modifications. The FetchExternalTasks command only executes internal code, so we are certain that a retry of a failed external task locking will not impact user data, and may be performed multiple times.- Specified by:
- isRetryablein interface- Command<List<LockedExternalTask>>
- Returns:
- true if the CrdbTransactionRetryInterceptorcan make a transparent retry of this command upon failure with aCrdbTransactionRetryException(only used when running on CockroachDB).
 
- 
filterOnOptimisticLockingFailureprotected void filterOnOptimisticLockingFailure(CommandContext commandContext, List<LockedExternalTask> tasks) 
- 
validateInputprotected void validateInput()
 
-