SimpleString address = RandomUtil.randomSimpleString();
SimpleString queue = RandomUtil.randomSimpleString();
session.createQueue(address, queue, null, false);
QueueControl queueControl = createManagementControl(address, queue);
Assert.assertEquals(0, queueControl.getConsumerCount());
ClientConsumer consumer = session.createConsumer(queue);
Assert.assertEquals(1, queueControl.getConsumerCount());
System.out.println("Consumers: " + queueControl.listConsumersAsJSON());
JSONArray obj = new JSONArray(queueControl.listConsumersAsJSON());
assertEquals(1, obj.length());
consumer.close();
Assert.assertEquals(0, queueControl.getConsumerCount());
obj = new JSONArray(queueControl.listConsumersAsJSON());
assertEquals(0, obj.length());
session.deleteQueue(queue);
}