Package org.camunda.bpm.engine.impl.cmd
Class FetchExternalTasksCmd
- java.lang.Object
-
- org.camunda.bpm.engine.impl.cmd.FetchExternalTasksCmd
-
- All Implemented Interfaces:
Command<java.util.List<LockedExternalTask>>
public class FetchExternalTasksCmd extends java.lang.Object implements Command<java.util.List<LockedExternalTask>>
- Author:
- Thorben Lindhauer, Christopher Zell
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,TopicFetchInstruction>
fetchInstructions
protected static EnginePersistenceLogger
LOG
protected int
maxResults
protected boolean
usePriority
protected java.lang.String
workerId
-
Constructor Summary
Constructors Constructor Description FetchExternalTasksCmd(java.lang.String workerId, int maxResults, java.util.Map<java.lang.String,TopicFetchInstruction> instructions)
FetchExternalTasksCmd(java.lang.String workerId, int maxResults, java.util.Map<java.lang.String,TopicFetchInstruction> instructions, boolean usePriority)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<LockedExternalTask>
execute(CommandContext commandContext)
protected void
filterOnOptimisticLockingFailure(CommandContext commandContext, java.util.List<LockedExternalTask> tasks)
boolean
isRetryable()
When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted.protected void
validateInput()
-
-
-
Field Detail
-
LOG
protected static final EnginePersistenceLogger LOG
-
workerId
protected java.lang.String workerId
-
maxResults
protected int maxResults
-
usePriority
protected boolean usePriority
-
fetchInstructions
protected java.util.Map<java.lang.String,TopicFetchInstruction> fetchInstructions
-
-
Constructor Detail
-
FetchExternalTasksCmd
public FetchExternalTasksCmd(java.lang.String workerId, int maxResults, java.util.Map<java.lang.String,TopicFetchInstruction> instructions)
-
FetchExternalTasksCmd
public FetchExternalTasksCmd(java.lang.String workerId, int maxResults, java.util.Map<java.lang.String,TopicFetchInstruction> instructions, boolean usePriority)
-
-
Method Detail
-
execute
public java.util.List<LockedExternalTask> execute(CommandContext commandContext)
- Specified by:
execute
in interfaceCommand<java.util.List<LockedExternalTask>>
-
isRetryable
public 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:
isRetryable
in interfaceCommand<java.util.List<LockedExternalTask>>
- Returns:
- true if the
CrdbTransactionRetryInterceptor
can make a transparent retry of this command upon failure with aCrdbTransactionRetryException
(only used when running on CockroachDB).
-
filterOnOptimisticLockingFailure
protected void filterOnOptimisticLockingFailure(CommandContext commandContext, java.util.List<LockedExternalTask> tasks)
-
validateInput
protected void validateInput()
-
-