Package org.acemq.amqp.core
Enum OrderedQueue.OnFailure
- All Implemented Interfaces:
Serializable,Comparable<OrderedQueue.OnFailure>
- Enclosing class:
OrderedQueue<T>
What happens when a handler fails. All three preserve order; they differ in what they cost.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRetry the same message, in the handler, with a delay between attempts.Give up on the message, acknowledge it, and carry on.Stop this partition and leave the message on the queue. -
Method Summary
Modifier and TypeMethodDescriptionstatic OrderedQueue.OnFailureReturns the enum constant of this type with the specified name.static OrderedQueue.OnFailure[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
STOP
Stop this partition and leave the message on the queue.The default. The sequence for every key in that partition pauses until somebody fixes the handler and restarts, and no message is lost or reordered. Other partitions carry on, so a bad message stops a fraction of the traffic rather than all of it.
-
RETRY_IN_PLACE
Retry the same message, in the handler, with a delay between attempts.Blocks the partition while it retries, which is exactly the intent: a transient failure resolves without breaking the sequence. Sleeping in a handler is wrong for an unordered consumer and right for this one. When the attempts run out it behaves as
STOP. -
SKIP
Give up on the message, acknowledge it, and carry on.Order is preserved for everything that follows, and one message has silently left the sequence. Only reasonable where the sequence is advisory.
OrderedQueue.skipped()is the only record that it happened, and is worth alerting on.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-