Binding binding = postOffice.getBinding(queueName);
if (binding == null)
{
throw new HornetQException(HornetQException.QUEUE_DOES_NOT_EXIST, "No such queue " + queueName);
}
Queue queue = (Queue)binding.getBindable();
if (queue.getPageSubscription() != null)
{
queue.getPageSubscription().close();
}
if (queue.getConsumerCount() != 0)
{
throw new HornetQException(HornetQException.ILLEGAL_STATE, "Cannot delete queue " + queue.getName() +
" on binding " +
queueName +
" - it has consumers = " +
binding.getClass().getName());
}