On 01/03/2014 04:50 AM, khandelwalanuj wrote:
Hey,

I ma getting confused between 'IdleTimeout' of pooledConnectionFactory and
maxInactivityDuration.
These are two very different things and each work in there own way.


*IdleTimeout *: For a Connection that is in the pool but has no current
users the idle timeout determines how long the Connection can live before it
is eligible for removal from the pool.
Right, so a connection that is checked out and is in use won't idle out, only one that has been created and then returned to the pool will be a candidate for idle processing. So if your client's are using the connection actively and haven't called close() on the returned Connection object then this option shouldn't come into play.

*maxInactivityDuration*: The InactivityMonitor expects to receive data on
the connection during a specified maxInactivityDuration. If normal activemq
traffic has not been sent across the connection during that period, it
assumes there is an issue with the connection. The InactivityMonitor throws
an InactivityIOException and shuts down the transport.
The inactivity monitor is used to more quickly detect failed connections between client and broker. It involves sending a heart beat message between the client and the broker in the absence of any message traffic. The connection won't be terminated just because your client hasn't sent or receive any messages, it only fails if the monitor is not able to hear anything from the broker.

-> Both has default value of 30 sec.

I am planning to increase the value of maxInactivityDuration from 30 sec to
2 mins for my ActiveMQ broker setup. I want Inactivity monitor to do the
read check per 2 mins and not close any connection before that.
But most of my clients uses pooled Connection factory for the connections,
So should I also need to specify "IdleTimeout" in pooled Connection Factory
to 2mins ?

Thanks,
Anuj

You don't need to sync up these values. Set a duration for inactivity that's tolerable to your application and configure the pool to drop idle connections in a time that you feel will comfortable with.





--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Difference-between-wireFormat-maxInactivityDuration-and-IdleTimeout-of-pooled-connection-Factory-tp4675972.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



--
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.b...@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply via email to