Interface TaskLifecycleListener
-
- All Known Implementing Classes:
CompositeTaskLifecycleListener,LoggingTaskLifecycleListener,NoopTaskLifecycleListener
public interface TaskLifecycleListenerListener for task processing lifecycle.- Since:
- 09.07.2017
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcrashed(QueueShardId shardId, QueueLocation location, TaskRecord taskRecord, java.lang.Exception exc)Event for abnormal queue processing.voidexecuted(QueueShardId shardId, QueueLocation location, TaskRecord taskRecord, TaskExecutionResult executionResult, long processTaskTime)Event for completion of client logic when task processing.voidfinished(QueueShardId shardId, QueueLocation location, TaskRecord taskRecord)Event for completion the task execution in the queue.voidpicked(QueueShardId shardId, QueueLocation location, TaskRecord taskRecord, long pickTaskTime)Event of task picking from the queue.voidstarted(QueueShardId shardId, QueueLocation location, TaskRecord taskRecord)The start event of task processing.
-
-
-
Method Detail
-
picked
void picked(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord, long pickTaskTime)Event of task picking from the queue.Triggered when there is a task in the queue, which is ready for processing.
Might be useful for monitoring problems with database performance.
- Parameters:
shardId- Shard identifier, which processes the queue.location- Queue location.taskRecord- Raw task data.pickTaskTime- Time spent on picking the task from the queue in millis.
-
started
void started(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord)The start event of task processing.Always triggered when task was picked.
Might be useful for updating a logging context.
- Parameters:
shardId- Shard identifier, which processes the queue.location- Queue location.taskRecord- Raw task data.
-
executed
void executed(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord, @Nonnull TaskExecutionResult executionResult, long processTaskTime)Event for completion of client logic when task processing.Always triggered when task processing has completed successfully.
Might be useful for monitoring successful execution of client logic.
- Parameters:
shardId- Shard identifier, which processes the queue.location- Queue location.taskRecord- Raw task data.executionResult- Result of task processing.processTaskTime- Time spent on task processing in millis, without the time for task picking from the queue.
-
finished
void finished(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord)Event for completion the task execution in the queue.Always triggered when task was picked up for processing. Called even after
crashed(ru.yoomoney.tech.dbqueue.config.QueueShardId, ru.yoomoney.tech.dbqueue.settings.QueueLocation, ru.yoomoney.tech.dbqueue.api.TaskRecord, java.lang.Exception).Might be useful for recovery of initial logging context state.
- Parameters:
shardId- Shard identifier, which processes the queue.location- Queue location.taskRecord- Raw task data.
-
crashed
void crashed(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord, @Nullable java.lang.Exception exc)Event for abnormal queue processing.Triggered when unexpected error occurs during task processing.
Might be useful for tracking and monitoring errors in the system.
- Parameters:
shardId- Shard identifier, which processes the queue.location- Queue location.taskRecord- Raw task data.exc- An error caused the crash.
-
-