Class ContainerUtils


  • public final class ContainerUtils
    extends java.lang.Object
    Utility methods for listener containers.
    Since:
    2.1
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isRejectManual​(java.lang.Throwable ex)
      Return true for AmqpRejectAndDontRequeueException.isRejectManual().
      static boolean shouldRequeue​(boolean defaultRequeueRejected, java.lang.Throwable throwable, org.apache.commons.logging.Log logger)
      Determine whether a message should be requeued; returns true if the throwable is a MessageRejectedWhileStoppingException or defaultRequeueRejected is true and there is not an AmqpRejectAndDontRequeueException in the cause chain or if there is an ImmediateRequeueAmqpException in the cause chain.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • shouldRequeue

        public static boolean shouldRequeue​(boolean defaultRequeueRejected,
                                            java.lang.Throwable throwable,
                                            org.apache.commons.logging.Log logger)
        Determine whether a message should be requeued; returns true if the throwable is a MessageRejectedWhileStoppingException or defaultRequeueRejected is true and there is not an AmqpRejectAndDontRequeueException in the cause chain or if there is an ImmediateRequeueAmqpException in the cause chain.
        Parameters:
        defaultRequeueRejected - the default requeue rejected.
        throwable - the throwable.
        logger - the logger to use for debug.
        Returns:
        true to requeue.
      • isRejectManual

        public static boolean isRejectManual​(java.lang.Throwable ex)
        Return true for AmqpRejectAndDontRequeueException.isRejectManual().
        Parameters:
        ex - the exception.
        Returns:
        the exception's rejectManual property, if it's an AmqpRejectAndDontRequeueException.
        Since:
        2.2