public void run()
{
try
{
Delivery del = null;
//We only get the delivery if receiversReady = false so as not to steal messages that
//might be consumed by local receivers
if (!receiversReady)
{
MessageReference ref;
synchronized (refLock)
{
ref = removeFirstInMemory();
if (ref != null)
{
del = new SimpleDelivery(LocalClusteredQueue.this, ref);
deliveringCount.increment();
}
}
}
if (trace) { log.trace("PullMessagesRunnable got " + del); }
if (del != null)
{
PullMessageResultRequest response =
new PullMessageResultRequest(LocalClusteredQueue.this.nodeId, txId.getTxId(),
name,
del.getReference().getMessage());
if (!del.getReference().getMessage().isReliable() || !recoverable)
{
//We can ack it now
del.acknowledge(null);
}
else
{
//Add this to the holding area
tx.setReliableDelivery(del);