activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: Question about "forced expiration" of connections
Date Thu, 05 May 2011 14:37:22 GMT
there is no timer thread in the pool, the checks for expiry; time
since first use, and idle timeout - time sense last used, are done
when a connection is returned to the pool via a close or got from the
pool.

So it works well in the getConnection() doWork() closeConnection()
pattern but with a long lived connection it won't kick in.

Have you looked at the transport inactivity monitor on the brokerURL,
that may help abort stale tcp connections.

On 5 May 2011 14:36, fabien.bk <fabien.benoit@gmail.com> wrote:
> 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.
>



-- 
http://blog.garytully.com
http://fusesource.com

Mime
View raw message