activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fabien.bk" <fabien.ben...@gmail.com>
Subject Question about "forced expiration" of connections
Date Thu, 05 May 2011 13:36:41 GMT
Hi.

Because of weird network problems (tcp connections becoming "stale" without
being closed explicitely after a few days), I need to make sure that the
connections used by my consumers are recreated frequently.

This is what I do at the startup of my application:

...
pooledConnectionFactory.setExpiryTimeout(60*1000); 
pooledConnectionFactory.setIdleTimeout(60*1000);
...
Connection brokerConnection = pooledConnectionFactory.createConnection();
Session session = brokerConnection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = session.createConsumer(<my queue>);
consumer.setMessageListener(<my listener>);

I set the activemq logger to debug, and i noticed that the connection is
established at the startup, but never renewed... According to the
documentation, the connection should expire regardless of the activity every
60s (with my settings). But I guess the logic is coded inside the pool, not
in the connection itself. 

Does this mean I need to close manually the connection and recreate the
connection/session/consumer every minute?

Thank you very much,

Fabien


--
View this message in context: http://activemq.2283324.n4.nabble.com/Question-about-forced-expiration-of-connections-tp3498356p3498356.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message