class LoadInformationController {

    @ResponseBody
    @RequestMapping(value = "/loadinformation", method = RequestMethod.GET)
    public Map<String, Long> getLoadInformation() {
        Map<String, Long> loadInformation = new HashMap<>();
        buildConnection();
        try {
            Long jmsQueueSize = (Long) jmsQueueConnection.getAttribute(jmsQueue, "QueueSize");
            loadInformation.put("loadInformation", jmsQueueSize);
        } catch (Exception e) {
            logger.error("Exception while monitoring queue sizes", e);
        }
        return loadInformation;
    }

}