Beispiel #1
0
 private void configureConnectionFactory() {
   ConnectionFactoryConfiguration cfConfig =
       new ConnectionFactoryConfigurationImpl("cf", false, singletonList("connector"), "/cf");
   /*see https://community.jboss.org/thread/160367
    Re: Connection timeout issues - Connection failure has been detected
    In my case, below configuration (made on JBoss 7.1.1.Final) has helped:
    <client-failure-check-period>2147483646</client-failure-check-period>
    <connection-ttl>-1</connection-ttl>
    <reconnect-attempts>-1</reconnect-attempts>
   */
   cfConfig.setClientFailureCheckPeriod(Long.MAX_VALUE);
   cfConfig.setConnectionTTL(-1);
   cfConfig.setReconnectAttempts(-1);
   jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);
 }