Interface DeadLetterQueue.DlqEventHandler<K>

Type Parameters:
K - the key type | 键类型
Enclosing class:
DeadLetterQueue<K>

public static interface DeadLetterQueue.DlqEventHandler<K>
DLQ event handler DLQ 事件处理器
Since:
JDK 25, opencode-base-cache V2.0.5
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • onAdd

      default void onAdd(K key, Throwable error)
      onAdd | onAdd
      Parameters:
      key - the key | key
      error - the error | error
    • onRetryFailed

      default void onRetryFailed(K key, Throwable error, int retryCount)
      onRetryFailed | onRetryFailed
      Parameters:
      key - the key | key
      error - the error | error
      retryCount - the retryCount | retryCount
    • onRecovered

      default void onRecovered(K key, int retryCount)
      onRecovered | onRecovered
      Parameters:
      key - the key | key
      retryCount - the retryCount | retryCount
    • onDiscard

      default void onDiscard(K key, DeadLetterQueue.DiscardReason reason)
      onDiscard | onDiscard
      Parameters:
      key - the key | key
      reason - the reason | reason
    • noOp

      static <K> DeadLetterQueue.DlqEventHandler<K> noOp()
      Returns a no-op handler | 返回空操作处理器
      Type Parameters:
      K - the key type | 键类型
      Returns:
      a no-op handler | 空操作处理器
    • logging

      static <K> DeadLetterQueue.DlqEventHandler<K> logging()
      Returns a logging handler | 返回日志处理器
      Type Parameters:
      K - the key type | 键类型
      Returns:
      a logging handler | 日志处理器