Package dev.agenor.core.mailbox
Enum Class OverflowPolicy
- All Implemented Interfaces:
Serializable,Comparable<OverflowPolicy>,Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDiscard the arriving message and log a warning, leaving the queue untouched.Discard the oldest queued message to make room for the arriving one, and log a warning.Refuse the arriving message and signal the failure to the sender rather than dropping it silently. -
Method Summary
Modifier and TypeMethodDescriptionstatic OverflowPolicyReturns the enum constant of this class with the specified name.static OverflowPolicy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Discard the arriving message and log a warning, leaving the queue untouched. -
REJECT
Refuse the arriving message and signal the failure to the sender rather than dropping it silently.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-