Class NoopTaskLifecycleListener
- java.lang.Object
-
- ru.yoomoney.tech.dbqueue.config.impl.NoopTaskLifecycleListener
-
- All Implemented Interfaces:
TaskLifecycleListener
public final class NoopTaskLifecycleListener extends java.lang.Object implements TaskLifecycleListener
Empty listener for task processing lifecycle.- Since:
- 02.10.2019
-
-
Constructor Summary
Constructors Constructor Description NoopTaskLifecycleListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.static NoopTaskLifecycleListenergetInstance()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
-
getInstance
@Nonnull public static NoopTaskLifecycleListener getInstance()
-
picked
public void picked(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord, long pickTaskTime)Description copied from interface:TaskLifecycleListenerEvent 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.
- Specified by:
pickedin interfaceTaskLifecycleListener- 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
public void started(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord)Description copied from interface:TaskLifecycleListenerThe start event of task processing.Always triggered when task was picked.
Might be useful for updating a logging context.
- Specified by:
startedin interfaceTaskLifecycleListener- Parameters:
shardId- Shard identifier, which processes the queue.location- Queue location.taskRecord- Raw task data.
-
executed
public void executed(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord, @Nonnull TaskExecutionResult executionResult, long processTaskTime)Description copied from interface:TaskLifecycleListenerEvent 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.
- Specified by:
executedin interfaceTaskLifecycleListener- 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
public void finished(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord)Description copied from interface:TaskLifecycleListenerEvent for completion the task execution in the queue.Always triggered when task was picked up for processing. Called even after
TaskLifecycleListener.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.
- Specified by:
finishedin interfaceTaskLifecycleListener- Parameters:
shardId- Shard identifier, which processes the queue.location- Queue location.taskRecord- Raw task data.
-
crashed
public void crashed(@Nonnull QueueShardId shardId, @Nonnull QueueLocation location, @Nonnull TaskRecord taskRecord, @Nullable java.lang.Exception exc)Description copied from interface:TaskLifecycleListenerEvent for abnormal queue processing.Triggered when unexpected error occurs during task processing.
Might be useful for tracking and monitoring errors in the system.
- Specified by:
crashedin interfaceTaskLifecycleListener- Parameters:
shardId- Shard identifier, which processes the queue.location- Queue location.taskRecord- Raw task data.exc- An error caused the crash.
-
-