Enum OrderedQueue.OnFailure

java.lang.Object
java.lang.Enum<OrderedQueue.OnFailure>
org.acemq.amqp.core.OrderedQueue.OnFailure
All Implemented Interfaces:
Serializable, Comparable<OrderedQueue.OnFailure>
Enclosing class:
OrderedQueue<T>

public static enum OrderedQueue.OnFailure extends Enum<OrderedQueue.OnFailure>
What happens when a handler fails. All three preserve order; they differ in what they cost.
  • Enum Constant Details

    • STOP

      public static final OrderedQueue.OnFailure 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

      public static final OrderedQueue.OnFailure 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

      public static final OrderedQueue.OnFailure 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

      public static OrderedQueue.OnFailure[] 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

      public static OrderedQueue.OnFailure valueOf(String name)
      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 name
      NullPointerException - if the argument is null