final ClientSessionFactory sf = createClientSessionFactory(managementClient.getMgmtAddress(), 5445);
final ModelControllerClient client = managementClient.getControllerClient();
// Check that the queue does not exists
if (queueExists(queueName, sf)) {
throw new IllegalStateException();
}
// Create a new core queue using the standalone client
ModelNode op = new ModelNode();
op.get("operation").set("add");
op.get("address").add("subsystem", "messaging");
op.get("address").add("hornetq-server", "default");
op.get("address").add("queue", queueName);
op.get("queue-address").set(queueName);
applyUpdate(op, client);
// Check if the queue exists
if (!queueExists(queueName, sf)) {
throw new IllegalStateException();
}
ClientSession session = null;
try {
session = sf.createSession("guest", "guest", false, false, false, false, 1);