activemq-users mailing list archives

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

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:

Connection brokerConnection = pooledConnectionFactory.createConnection();
Session session = brokerConnection.createSession(false,
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,


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message