//iterate through an scrub delivered but expired messages
while ((message = (ActiveMQMessage)messageQueue.dequeueNoWait())!= null){
boolean expired = message.isExpired();
messageDelivered(message,true,expired);
if (!expired){
return message.shallowCopy();
}
}
}
catch (InterruptedException ioe) {
throw new JMSException("Queue is interrupted: " + ioe.getMessage());