//for (int x = ackList.size()-1; x >= 0 ; x--){
for (int x = 0; x < ackList.size(); x++){
DurableMessagePointer messagePointer = (DurableMessagePointer) ackList.get(x);
ActiveMQMessage message = messagePointer.getMessage();
message.setJMSRedelivered(true);
if (message.incrementDeliveryCount() >= redeliveryPolicy.getMaximumRetryCount()) {
if (log.isDebugEnabled()){
log.debug("Message: " + message + " has exceeded its retry count");
}
// TODO: see if we can use the deadLetterPolicy of the container that dispatched the message.
deadLetterPolicy.sendToDeadLetter(message);