// start from the top of the cache and remove each
// message and then call destroy on it.
while (!_unackedMessages.isEmpty()) {
MessageHandle handle
= (MessageHandle) _unackedMessages.remove(0);
handle.destroy();
// if the handle is equal to the source handle then
// break the loop
if (handle.getConsumerId() == consumerId
&& handle.getMessageId().equals(messageId)) {