protected ActiveMQConnectionFactory createConnectionFactory(String config, String brokerName,
String connectUrl) throws JMSException {
try {
BrokerFactoryBean brokerFactory = new BrokerFactoryBean(new ClassPathResource(config));
brokerFactory.afterPropertiesSet();
BrokerService broker = brokerFactory.getBroker();
brokers.put(brokerName, broker);
return new ActiveMQConnectionFactory(connectUrl);