}
}
for (Map.Entry<Long, MessageInstance> entry : msgToResend.entrySet())
{
MessageInstance message = entry.getValue();
long deliveryTag = entry.getKey();
//Amend the delivery counter as the client hasn't seen these messages yet.
message.decrementDeliveryCount();
// Without any details from the client about what has been processed we have to mark
// all messages in the unacked map as redelivered.
message.setRedelivered();
if (!message.resend())
{
msgToRequeue.put(deliveryTag, message);
}
} // for all messages
// } else !isSuspend
if (_logger.isInfoEnabled())
{
if (!msgToRequeue.isEmpty())
{
_logger.info("Preparing (" + msgToRequeue.size() + ") message to requeue to.");
}
}
// Process Messages to Requeue at the front of the queue
for (Map.Entry<Long, MessageInstance> entry : msgToRequeue.entrySet())
{
MessageInstance message = entry.getValue();
long deliveryTag = entry.getKey();
//Amend the delivery counter as the client hasn't seen these messages yet.
message.decrementDeliveryCount();
_unacknowledgedMessageMap.remove(deliveryTag);
message.setRedelivered();
message.release();
}
}