Interface AcknowledgerConsumerWorker.AcknowledgementFailureHandler

Enclosing class:
AcknowledgerConsumerWorker<T extends Acknowledgeable>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface AcknowledgerConsumerWorker.AcknowledgementFailureHandler
Allows the user to customize the behavior of the worker when an acknowledgement fails.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called when an ack fails.
  • Method Details

    • onAckFailure

      void onAckFailure(Throwable t) throws Throwable
      Called when an ack fails. If the user wants the task to continue, then they should simply return. If the user wants the task to fail, then they should throw a Throwable, either the given one or a new one.

      The underlying implementation handles InterruptedException and Error instances for correctness, so those causes cannot be intercepted. Also, as a rule, users should not throw these types from this method.

      Parameters:
      t - the failure cause
      Throws:
      Throwable - the failure cause, if the user wants the task to fail