Class LoggingTaskLifecycleListener

    • Constructor Detail

      • LoggingTaskLifecycleListener

        public LoggingTaskLifecycleListener()
        Constructor
    • Method Detail

      • picked

        public void picked​(@Nonnull
                           QueueShardId shardId,
                           @Nonnull
                           QueueLocation location,
                           @Nonnull
                           TaskRecord taskRecord,
                           long pickTaskTime)
        Description copied from interface: TaskLifecycleListener
        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.

        Specified by:
        picked in interface TaskLifecycleListener
        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: TaskLifecycleListener
        The start event of task processing.

        Always triggered when task was picked.

        Might be useful for updating a logging context.

        Specified by:
        started in interface TaskLifecycleListener
        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: TaskLifecycleListener
        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.

        Specified by:
        executed in interface TaskLifecycleListener
        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.
      • crashed

        public void crashed​(@Nonnull
                            QueueShardId shardId,
                            @Nonnull
                            QueueLocation location,
                            @Nonnull
                            TaskRecord taskRecord,
                            @Nullable
                            java.lang.Exception exc)
        Description copied from interface: TaskLifecycleListener
        Event 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:
        crashed in interface TaskLifecycleListener
        Parameters:
        shardId - Shard identifier, which processes the queue.
        location - Queue location.
        taskRecord - Raw task data.
        exc - An error caused the crash.