Search in sources :

Example 1 with ConsumerConnctionFactory

use of com.jim.framework.activemq.producer.ConsumerConnctionFactory in project jim-framework by jiangmin168168.

the class ConnectionFactoryContainer method getConsumerConnectionFactory.

public static PooledConnectionFactory getConsumerConnectionFactory(String brokerUrl) {
    PooledConnectionFactory connectionFactory = null;
    synchronized (lock) {
        if (consumerConnectionFactoryMap.containsKey(brokerUrl)) {
            connectionFactory = (PooledConnectionFactory) consumerConnectionFactoryMap.get(brokerUrl);
        } else {
            ConsumerConnctionFactory consumerConnctionFactory = new ConsumerConnctionFactory();
            // producerConnctionFactory.init();
            connectionFactory = consumerConnctionFactory.create(brokerUrl);
            consumerConnectionFactoryMap.put(brokerUrl, connectionFactory);
        }
        return connectionFactory;
    }
}
Also used : PooledConnectionFactory(org.apache.activemq.pool.PooledConnectionFactory) ConsumerConnctionFactory(com.jim.framework.activemq.producer.ConsumerConnctionFactory)

Aggregations

ConsumerConnctionFactory (com.jim.framework.activemq.producer.ConsumerConnctionFactory)1 PooledConnectionFactory (org.apache.activemq.pool.PooledConnectionFactory)1