https://issues.apache.org/jira/browse/AMQ-5146 - durable sub redelivery test regression https://issues.apache.org/jira/browse/AMQ-5156 - pre delivery check for max redelivery should only apply to transacted sessions

This commit is contained in:
gtully 2014-04-24 10:52:03 +01:00
parent fdc2551eb8
commit f70dc74312
1 changed files with 3 additions and 2 deletions

View File

@ -524,12 +524,13 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
private boolean redeliveryExceeded(MessageDispatch md) {
try {
return redeliveryPolicy != null
return session.getTransacted()
&& redeliveryPolicy != null
&& redeliveryPolicy.getMaximumRedeliveries() != RedeliveryPolicy.NO_MAXIMUM_REDELIVERIES
&& md.getRedeliveryCounter() > redeliveryPolicy.getMaximumRedeliveries()
// redeliveryCounter > x expected after resend via brokerRedeliveryPlugin
&& md.getMessage().getProperty("redeliveryDelay") == null;
} catch (IOException ignored) {
} catch (Exception ignored) {
return false;
}
}