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