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

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

Introduction

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

Prototype

public void setSessionCacheSize(int sessionCacheSize) 

Source Link

Document

Specify the desired size for the JMS Session cache (per JMS Session type).

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:com.apress.prospringintegration.messaging.hornetq.jms.adapter.HornetqConfiguration.java

@Bean
public CachingConnectionFactory connectionFactory() {
    CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
    cachingConnectionFactory.setSessionCacheSize(10);
    cachingConnectionFactory.setCacheProducers(false);
    cachingConnectionFactory.setTargetConnectionFactory(hornetQConnectionFactory());
    return cachingConnectionFactory;
}

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:ru.anr.base.facade.jmsclient.JmsConfig.java

/**
 * Cached factory (wrapper for jms factory from JNDI). Expects a bean
 * 'jmsConnectionFactory' defined in current context.
 * //  w ww.j  a  va2s.  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:com.apress.prospringintegration.transform.IntegrationConfiguration.java

@Bean
public CachingConnectionFactory cachingConnectionFactory() {
    CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
    cachingConnectionFactory.setTargetConnectionFactory(activeMQConnectionFactory());
    cachingConnectionFactory.setSessionCacheSize(10);
    cachingConnectionFactory.setCacheProducers(false);
    return cachingConnectionFactory;
}

From source file:com.apress.prospringintegration.messaging.qpid.jms.adapter.QpidConfiguration.java

@Bean
public CachingConnectionFactory connectionFactory() {
    CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
    cachingConnectionFactory.setTargetConnectionFactory(connectionFactory);
    cachingConnectionFactory.setSessionCacheSize(10);

    return cachingConnectionFactory;
}

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

private ConnectionFactory connectionFactory() {
    final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(
            amqConnectionFactory());// ww  w  . j a  v a 2s .com
    cachingConnectionFactory.setExceptionListener(jmsExceptionListener());
    cachingConnectionFactory.setSessionCacheSize(sessionCacheSize);
    return cachingConnectionFactory;
}

From source file:io.galeb.health.configurations.JMSConfiguration.java

@Bean(name = "connectionFactory")
public CachingConnectionFactory cachingConnectionFactory() throws JMSException {
    CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(BROKER_CONN);
    connectionFactory.setUser(BROKER_USER);
    connectionFactory.setPassword(BROKER_PASS);
    if (BROKER_HA) {
        connectionFactory.setConnectionLoadBalancingPolicyClassName(
                RoundRobinConnectionLoadBalancingPolicy.class.getName());
    }//from ww  w . ja  va 2s  . c  o  m
    cachingConnectionFactory.setTargetConnectionFactory(connectionFactory);
    cachingConnectionFactory.setSessionCacheSize(100);
    cachingConnectionFactory.setCacheConsumers(true);
    return cachingConnectionFactory;
}