private void forceDequeue(final MessageInstance entry, final boolean restoreCredit) { AutoCommitTransaction dequeueTxn = new AutoCommitTransaction(_session.getAddressSpace().getMessageStore()); dequeueTxn.dequeue(entry.getEnqueueRecord(), new ServerTransaction.Action() { @Override public void postCommit() { if (restoreCredit) { restoreCredit(entry.getMessage()); } entry.delete(); } @Override public void onRollback() { } }); }
@Override public void addPostTransactionAction(Action postTransactionAction) { if(_branch != null) { _branch.addPostTransactionAction(postTransactionAction); } else { _autoCommitTransaction.addPostTransactionAction(postTransactionAction); } }
_autoCommitTransaction.enqueue(queues, message, postTransactionAction);
public DistributedTransaction(AMQPSession<?,?> session, DtxRegistry dtxRegistry) { _session = session; _dtxRegistry = dtxRegistry; _autoCommitTransaction = new AutoCommitTransaction(dtxRegistry.getMessageStore()); }
@Override public void dequeue(MessageEnqueueRecord record, Action postTransactionAction) { if(_branch != null) { _branch.dequeue(record); _branch.addPostTransactionAction(postTransactionAction); } else { _autoCommitTransaction.dequeue(record, postTransactionAction); } }
@Override public void dequeue(MessageEnqueueRecord record, Action postTransactionAction) { Transaction txn = null; try { if(record != null) { LOGGER.debug("Dequeue of message number {} from transaction log. Queue : {}", record.getMessageNumber(), record.getQueueId()); txn = _messageStore.newTransaction(); txn.dequeueMessage(record); txn.commitTran(); txn = null; } postTransactionAction.postCommit(); postTransactionAction = null; } finally { rollbackIfNecessary(postTransactionAction, txn); } }
public NoAckConsumer(AMQChannel channel, AMQShortString consumerTag, FieldTable filters, FlowCreditManager_0_8 creditManager, ClientDeliveryMethod deliveryMethod, boolean multiQueue) { super(channel, consumerTag, filters, creditManager, deliveryMethod, multiQueue); _txn = new AutoCommitTransaction(channel.getAddressSpace().getMessageStore()); }
@Override public void dequeue(Collection<MessageInstance> messages, Action postTransactionAction) { if(_branch != null) { for(MessageInstance entry : messages) { _branch.dequeue(entry.getEnqueueRecord()); } _branch.addPostTransactionAction(postTransactionAction); } else { _autoCommitTransaction.dequeue(messages, postTransactionAction); } }
rollbackIfNecessary(postTransactionAction, txn);
AutoCommitTransaction txn = new AutoCommitTransaction(addressSpace.getMessageStore()); if (queueEntry.acquire() || queueEntry.isAcquired()) txn.dequeue(Collections.singleton(queueEntry), new ServerTransaction.Action() AutoCommitTransaction txn = new AutoCommitTransaction(addressSpace.getMessageStore()); txn.dequeue(Collections.singleton(queueEntry), new ServerTransaction.Action()
private void dequeueEntry(final QueueEntry node) { ServerTransaction txn = new AutoCommitTransaction(getVirtualHost().getMessageStore()); dequeueEntry(node, txn); }
@Override protected void doSendInternal(final MessageInstanceConsumer consumer, final MessageInstance entry, final AMQMessage message, final boolean batch) { // if we do not need to wait for client acknowledgements // we can decrement the reference count immediately. // By doing this _before_ the send we ensure that it // doesn't get sent if it can't be dequeued, preventing // duplicate delivery on recovery. // The send may of course still fail, in which case, as // the message is unacked, it will be lost. _txn.dequeue(entry.getEnqueueRecord(), NOOP); try( MessageReference ref = entry.getMessage().newReference()) { InstanceProperties props = entry.getInstanceProperties(); entry.delete(); getChannel().getConnection().setDeferFlush(batch); long deliveryTag = getChannel().getNextDeliveryTag(); sendToClient(consumer, message, props, deliveryTag); } }
_autoCommitTransaction.enqueue(queue, message, postTransactionAction);
AutoCommitTransaction txn = new AutoCommitTransaction(getMessageStore()); final InstanceProperties instanceProperties = new InstanceProperties()
private void discardEntry(final QueueEntry entry) { if(entry.acquire()) { ServerTransaction txn = new AutoCommitTransaction(getQueue().getVirtualHost().getMessageStore()); txn.dequeue(entry.getEnqueueRecord(), new ServerTransaction.Action() { @Override public void postCommit() { entry.delete(); } @Override public void onRollback() { } }); } }
public void run() ServerTransaction txn = new AutoCommitTransaction(store); txn.dequeue(messageInstance.getEnqueueRecord(), deleteAction);