Enum Class OverflowPolicy

java.lang.Object
java.lang.Enum<OverflowPolicy>
dev.agenor.core.mailbox.OverflowPolicy
All Implemented Interfaces:
Serializable, Comparable<OverflowPolicy>, Constable

public enum OverflowPolicy extends Enum<OverflowPolicy>
What a mailbox does with a message it has no room for.

Blocking the producer is deliberately not offered: the producer may be a transport consumer loop serving many agents, and stalling it would turn one slow agent into a node-wide outage.

Since:
0.27.0
  • Enum Constant Details

    • DROP_OLDEST

      public static final OverflowPolicy DROP_OLDEST
      Discard the oldest queued message to make room for the arriving one, and log a warning. Keeps the agent responsive to current traffic at the cost of history.
    • DROP_NEWEST

      public static final OverflowPolicy DROP_NEWEST
      Discard the arriving message and log a warning, leaving the queue untouched.
    • REJECT

      public static final OverflowPolicy REJECT
      Refuse the arriving message and signal the failure to the sender rather than dropping it silently.
  • Method Details

    • values

      public static OverflowPolicy[] 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 OverflowPolicy 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