Class ContainerUtils
java.lang.Object
org.springframework.amqp.rabbit.listener.support.ContainerUtils
Utility methods for listener containers.
- Since:
- 2.1
- Author:
- Gary Russell, Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Return true forAmqpRejectAndDontRequeueException.isRejectManual()
.static boolean
shouldRequeue
(boolean defaultRequeueRejected, Throwable throwable, Log logger) Determine whether a message should be requeued; returns true if the throwable is aMessageRejectedWhileStoppingException
or defaultRequeueRejected is true and there is not anAmqpRejectAndDontRequeueException
in the cause chain or if there is anImmediateRequeueAmqpException
in the cause chain.
-
Method Details
-
shouldRequeue
public static boolean shouldRequeue(boolean defaultRequeueRejected, Throwable throwable, Log logger) Determine whether a message should be requeued; returns true if the throwable is aMessageRejectedWhileStoppingException
or defaultRequeueRejected is true and there is not anAmqpRejectAndDontRequeueException
in the cause chain or if there is anImmediateRequeueAmqpException
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
Return true forAmqpRejectAndDontRequeueException.isRejectManual()
.- Parameters:
ex
- the exception.- Returns:
- the exception's rejectManual property, if it's an
AmqpRejectAndDontRequeueException
. - Since:
- 2.2
-