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

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

Introduction

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

Prototype

public void setReconnectOnException(boolean reconnectOnException) 

Source Link

Document

Specify whether the single Connection should be reset (to be subsequently renewed) when a JMSException is reported by the underlying Connection.

Usage

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.
 * //from  w  w  w .  ja v a2  s .  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;
}