// Without any details from the client about what has been processed we have to mark
// all messages in the unacked map as redelivered.
msg.setRedelivered(true);
Subscription sub = msg.getDeliveredSubscription(message.queue);
if (sub != null)
{
// Get the lock so we can tell if the sub scription has closed.
// will stop delivery to this subscription until the lock is released.
// note: this approach would allow the use of a single queue if the
// PreDeliveryQueue would allow head additions.
// In the Java Qpid client we are suspended whilst doing this so it is all rather Mute..
// needs guidance from AMQP WG Model SIG
synchronized (sub.getSendLock())
{
if (sub.isClosed())
{
if (_log.isDebugEnabled())
{
_log.debug("Subscription(" + System.identityHashCode(sub)
+ ") closed during resend so requeuing message");
}
// move this message to requeue
msgToRequeue.add(message);
}
else
{
if (_log.isDebugEnabled())
{
_log.debug("Requeuing " + msg.debugIdentity() + " for resend via sub:"
+ System.identityHashCode(sub));
}
sub.addToResendQueue(msg);
_unacknowledgedMessageMap.remove(message.deliveryTag);
}
} // sync(sub.getSendLock)
}
else