SimpleString queueName = new SimpleString(name);
ClientSession.QueueQuery query = session.queueQuery(queueName);
if (query.isExists())
{
session.deleteQueue(queueName);
}
else
{
throw new WebApplicationException(Response.status(405).type("text/plain").entity("Queue '" + name + "' does not exist").build());
}