ClientRequestor requestor = new ClientRequestor(managementSession, "jms.queue.hornetq.management");
ClientMessage managementMessage = managementSession.createMessage(false);
ManagementHelper.putAttribute(managementMessage, "core.queue." + queue, "ID");
managementSession.start();
HornetQLogger.LOGGER.debug("Requesting ID for: " + queue);
ClientMessage reply = requestor.request(managementMessage);
queueID = (Integer) ManagementHelper.getResult(reply);
requestor.close();
HornetQLogger.LOGGER.debug("ID for " + queue + " is: " + queueID);
queueIDs.put(queue, queueID); // store it so we don't have to look it up every time
}