use of com.jim.framework.activemq.producer.ProducerConnctionFactory in project jim-framework by jiangmin168168.
the class ConnectionFactoryContainer method createPooledConnectionFactory.
public static PooledConnectionFactory createPooledConnectionFactory(String brokerUrl) {
final String brokerClusterUrl = brokerUrl.replace(";", ",");
PooledConnectionFactory connectionFactory = null;
// ((ActiveMQConnectionFactory)connectionFactory.getConnectionFactory()).get;
synchronized (lock) {
if (producerConnectionFactoryMap.containsKey(brokerClusterUrl)) {
connectionFactory = producerConnectionFactoryMap.get(brokerClusterUrl);
needToRemoveConnctionFactories.add(connectionFactory);
producerConnectionFactoryMap.remove(brokerUrl);
}
ProducerConnctionFactory producerConnctionFactory = new ProducerConnctionFactory();
// producerConnctionFactory.init();
connectionFactory = producerConnctionFactory.create(brokerClusterUrl);
producerConnectionFactoryMap.put(brokerClusterUrl, connectionFactory);
return connectionFactory;
}
}
use of com.jim.framework.activemq.producer.ProducerConnctionFactory in project jim-framework by jiangmin168168.
the class ConnectionFactoryContainer method getPooledConnectionFactory.
public static PooledConnectionFactory getPooledConnectionFactory(String brokerUrl) {
final String brokerClusterUrl = brokerUrl.replace(";", ",");
PooledConnectionFactory connectionFactory = null;
// ((ActiveMQConnectionFactory)connectionFactory.getConnectionFactory()).get;
synchronized (lock) {
if (producerConnectionFactoryMap.containsKey(brokerClusterUrl)) {
connectionFactory = producerConnectionFactoryMap.get(brokerClusterUrl);
} else {
ProducerConnctionFactory producerConnctionFactory = new ProducerConnctionFactory();
// producerConnctionFactory.init();
connectionFactory = producerConnctionFactory.create(brokerClusterUrl);
producerConnectionFactoryMap.put(brokerClusterUrl, connectionFactory);
}
return connectionFactory;
}
}
Aggregations