Example usage for org.springframework.jms.connection CachingConnectionFactory CachingConnectionFactory

List of usage examples for org.springframework.jms.connection CachingConnectionFactory CachingConnectionFactory

Introduction

In this page you can find the example usage for org.springframework.jms.connection CachingConnectionFactory CachingConnectionFactory.

Prototype

public CachingConnectionFactory(ConnectionFactory targetConnectionFactory) 

Source Link

Document

Create a new CachingConnectionFactory for the given target ConnectionFactory.

Usage

From source file:com.apress.prospringintegration.JmsConfiguration.java

@Bean(name = "connectionFactory")
public ConnectionFactory getConnectionFactory() {
    ActiveMQConnectionFactory targetConnectionFactory = new ActiveMQConnectionFactory();
    targetConnectionFactory.setBrokerURL("vm://localhost");

    CachingConnectionFactory connectionFactory = new CachingConnectionFactory(targetConnectionFactory);
    connectionFactory.setSessionCacheSize(10);
    connectionFactory.setCacheProducers(false);

    return connectionFactory;
}

From source file:com.apress.prospringintegration.messagehistory.JmsConfiguration.java

@Bean
public ConnectionFactory connectionFactory() {
    ActiveMQConnectionFactory targetConnectionFactory = new ActiveMQConnectionFactory();
    targetConnectionFactory.setBrokerURL("vm://localhost");

    CachingConnectionFactory connectionFactory = new CachingConnectionFactory(targetConnectionFactory);
    connectionFactory.setSessionCacheSize(10);
    connectionFactory.setCacheProducers(false);

    return connectionFactory;
}

From source file:edu.berkeley.path.next.CTMEngine.JmsConfiguration.java

@Bean
public ConnectionFactory connectionFactory() {
    ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory();
    activeMQConnectionFactory.setBrokerURL("tcp://localhost:61616");

    CachingConnectionFactory connectionFactory = new CachingConnectionFactory(activeMQConnectionFactory);
    connectionFactory.setSessionCacheSize(10);
    connectionFactory.setCacheProducers(false);

    return connectionFactory;
}

From source file:jms001.ApplicationConfiguration.java

@Bean
public QueueConnectionFactory jmsConnectionFactory() {
    ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory("vm://localhost");
    return new CachingConnectionFactory(activeMQConnectionFactory);
}

From source file:hello.JmsConfig.java

@Bean
public ConnectionFactory connectionFactory() {
    return new CachingConnectionFactory(new ActiveMQConnectionFactory("failover:(tcp://127.0.0.1:61616)"));
}

From source file:me.adaptive.core.metrics.ActiveMQApplication.java

@Bean(name = "connectionFactory")
public CachingConnectionFactory connectionFactory() {
    return new CachingConnectionFactory(amqConnectionFactory());
}

From source file:ru.anr.base.facade.jmsclient.JmsConfig.java

/**
 * Cached factory (wrapper for jms factory from JNDI). Expects a bean
 * 'jmsConnectionFactory' defined in current context.
 * /* w  w w  .java2s  . c o m*/
 * @param connectionFactory
 *            JMS Connection factory
 * @return Bean instance
 */
@Bean(name = "connectionFactory")
@DependsOn("jmsConnectionFactory")
public CachingConnectionFactory cachedFactory(
        @Qualifier("jmsConnectionFactory") ConnectionFactory connectionFactory) {

    CachingConnectionFactory f = new CachingConnectionFactory(connectionFactory);
    f.setSessionCacheSize(100);

    // Doesn't work with Glassfish client ??
    f.setReconnectOnException(false);
    return f;
}

From source file:uk.ac.kcl.batch.RemoteConfiguration.java

@Bean
public CachingConnectionFactory connectionFactory(ActiveMQConnectionFactory factory) {
    return new CachingConnectionFactory(factory);
}

From source file:com.athena.dolly.common.core.ActiveMQPlaygroundConfiguration.java

private ConnectionFactory connectionFactory() {
    final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(
            amqConnectionFactory());/*w  w w  .  j ava2  s .c  o  m*/
    cachingConnectionFactory.setExceptionListener(jmsExceptionListener());
    cachingConnectionFactory.setSessionCacheSize(sessionCacheSize);
    return cachingConnectionFactory;
}

From source file:org.springframework.integration.jms.SubscribableJmsChannelTests.java

@Before
public void setup() throws Exception {
    ActiveMQConnectionFactory targetConnectionFactory = new ActiveMQConnectionFactory();
    this.connectionFactory = new CachingConnectionFactory(targetConnectionFactory);
    targetConnectionFactory.setBrokerURL("vm://localhost?broker.persistent=false");
    this.topic = new ActiveMQTopic("testTopic");
    this.queue = new ActiveMQQueue("testQueue");
}