{
boolean acquired = messageInstance.acquire();
if(!acquired && messageInstance instanceof QueueEntry)
{
QueueEntry entry = (QueueEntry) messageInstance;
QueueConsumer consumer = (QueueConsumer) entry.getDeliveredConsumer();
acquired = messageInstance.removeAcquisitionFromConsumer(consumer);
if(acquired)
{
consumer.acquisitionRemoved((QueueEntry)messageInstance);
}
}
if(acquired)
{
txn.dequeue(messageInstance.getOwningResource(), messageInstance.getMessage(), new ServerTransaction.Action()