Package org.camunda.bpm.client.backoff
Interface ErrorAwareBackoffStrategy
- All Superinterfaces:
BackoffStrategy
- All Known Implementing Classes:
ExponentialErrorBackoffStrategy
Provides a way to define a back off between fetch and lock requests.
Note: Since an implementation of this interface may be executed by multiple threads, it is recommended to implement the custom backoff strategy in a thread-safe manner.
-
Method Summary
Modifier and TypeMethodDescriptionlongCalculates the back off time and is invoked afterreconfigure(List, ExternalTaskClientException).default voidreconfigure(List<ExternalTask> externalTasks) This is to provide compatibility with existing BackoffStrategy configurations.voidreconfigure(List<ExternalTask> externalTasks, ExternalTaskClientException exception) Reconfigures the back off strategy based on the fetched external tasks and any error that might have occurred.
-
Method Details
-
reconfigure
This is to provide compatibility with existing BackoffStrategy configurations. Do not override. Implementations of ErrorAwareBackoffStrategy should overridereconfigure(List, ExternalTaskClientException)instead.- Specified by:
reconfigurein interfaceBackoffStrategy- Parameters:
externalTasks- which have been fetched
-
reconfigure
Reconfigures the back off strategy based on the fetched external tasks and any error that might have occurred. It is invoked before
calculateBackoffTime().The implementation might count the amount of invocations and realize a strategy reset.
- Parameters:
externalTasks- which have been fetchedexception- can be of the following types:EngineExceptionif something went wrong during the engine execution (e.g., a persistence exception occurred).BadRequestExceptionif an illegal operation was performed or the given data is invalid.ConnectionLostExceptionif the connection could not be established.UnknownHttpErrorExceptionif the HTTP status code is not known by the client.
-
calculateBackoffTime
long calculateBackoffTime()Calculates the back off time and is invoked after
reconfigure(List, ExternalTaskClientException).- Specified by:
calculateBackoffTimein interfaceBackoffStrategy- Returns:
- the back off time between fetch and lock requests in milliseconds
-