Enum Class OutboxStatus

java.lang.Object
java.lang.Enum<OutboxStatus>
io.leandev.appfuse.notification.outbox.OutboxStatus
All Implemented Interfaces:
Serializable, Comparable<OutboxStatus>, Constable

public enum OutboxStatus extends Enum<OutboxStatus>

Outbox 列的遞送狀態

狀態機:PENDING →(認領)SENDING →(遞送成功)SENT /(遞送失敗、仍可重試)FAILED →(逾重試上限)DEAD; 或 →(政策封鎖,如防火牆全擋)SUPPRESSEDFAILED 由輪詢器到 nextAttemptAt 時重試,可回到 SENT 或續留 FAILED,逾 maxAttemptsDEADSUPPRESSED 為確定性封鎖、不重試(重試無益),與 DEAD(重試耗盡)語意區分。

SENDING認領中的過渡態:fast-path 與輪詢器遞送前先原子認領(PENDING/FAILEDSENDING), 確保同一列在叢集多節點下只被一個執行緒遞送(見 NotificationOutboxRepositoryBase.claim(UUID, Instant, Instant))。認領時把 nextAttemptAt 推遲至 now + claimTimeout;若遞送節點於送出中崩潰,列滯留 SENDING,逾時後 (nextAttemptAt <= now)由輪詢自然重新認領——復原重用既有到期查詢、無額外機制。

Since:
4.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    逾重試上限、放棄遞送(dead-letter 終態,待人工檢視)
    遞送失敗、仍在重試視窗內(等待 nextAttemptAt 重試)
    待遞送(尚未試送,或已排定下次嘗試時間)
    認領中(過渡態):已被某執行緒原子認領、遞送進行中。崩潰滯留者逾 nextAttemptAt 由輪詢重新認領
    已遞送成功(終態)
    因政策被抑制、未遞送(終態)。確定性封鎖(收件者全不在郵件白名單 / 防火牆啟用卻無白名單), 重試不會改變結果,故不進重試。與 DEAD(重試耗盡)區分,供告警與稽核辨識。
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static OutboxStatus[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • PENDING

      public static final OutboxStatus PENDING
      待遞送(尚未試送,或已排定下次嘗試時間)
    • SENDING

      public static final OutboxStatus SENDING
      認領中(過渡態):已被某執行緒原子認領、遞送進行中。崩潰滯留者逾 nextAttemptAt 由輪詢重新認領
    • SENT

      public static final OutboxStatus SENT
      已遞送成功(終態)
    • FAILED

      public static final OutboxStatus FAILED
      遞送失敗、仍在重試視窗內(等待 nextAttemptAt 重試)
    • DEAD

      public static final OutboxStatus DEAD
      逾重試上限、放棄遞送(dead-letter 終態,待人工檢視)
    • SUPPRESSED

      public static final OutboxStatus SUPPRESSED
      因政策被抑制、未遞送(終態)。確定性封鎖(收件者全不在郵件白名單 / 防火牆啟用卻無白名單), 重試不會改變結果,故不進重試。與 DEAD(重試耗盡)區分,供告警與稽核辨識。
  • Method Details

    • values

      public static OutboxStatus[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OutboxStatus valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null