String configFile = getServletContext().getInitParameter("org.activemq.config.file");
if (configFile == null) {
configFile="activemq.xml";
}
BrokerFactoryBean factory = new BrokerFactoryBean(new ClassPathResource(configFile));
factory.afterPropertiesSet();
return factory.getBroker();
}