}
}
public void dequeue(Collection<QueueEntry> queueEntries, Action postTransactionAction)
{
Transaction txn = null;
try
{
for(QueueEntry entry : queueEntries)
{
ServerMessage message = entry.getMessage();
BaseQueue queue = entry.getQueue();
if(message.isPersistent() && queue.isDurable())
{
if (_logger.isDebugEnabled())
{
_logger.debug("Dequeue of message number " + message.getMessageNumber() + " from transaction log. Queue : " + queue.getName());
}
if(txn == null)
{
txn = _messageStore.newTransaction();
}
txn.dequeueMessage(queue, message);
}
}
StoreFuture future;
if(txn != null)
{
future = txn.commitTranAsync();
txn = null;
}
else
{
future = StoreFuture.IMMEDIATE_FUTURE;