use of org.apache.activemq.artemis.core.transaction.impl.BindingsTransactionImpl in project activemq-artemis by apache.
the class QueueImpl method deleteQueue.
@Override
public void deleteQueue(boolean removeConsumers) throws Exception {
synchronized (this) {
if (this.queueDestroyed)
return;
this.queueDestroyed = true;
}
Transaction tx = new BindingsTransactionImpl(storageManager);
try {
deleteAllReferences();
destroyPaging();
postOffice.removeBinding(name, tx, true);
if (removeConsumers) {
for (ConsumerHolder consumerHolder : consumerList) {
consumerHolder.consumer.disconnect();
}
}
if (isDurable()) {
storageManager.deleteQueueBinding(tx.getID(), getID());
tx.setContainsPersistent();
}
if (slowConsumerReaperFuture != null) {
slowConsumerReaperFuture.cancel(false);
}
tx.commit();
} catch (Exception e) {
tx.rollback();
throw e;
} finally {
if (factory != null) {
factory.queueRemoved(this);
}
}
}
Aggregations