activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: ExceptionListener behavior in Connection class and NMS 1.2.0
Date Tue, 05 Jan 2010 22:33:21 GMT
On Tue, 2010-01-05 at 14:23 -0800, zdvickery wrote:
> I am currently performing some asychronous messaging functionality using
> ActiveMQ/NMS.  For various reasons, my process is connected to an ActiveMQ
> server which restarts periodically.  I have observed the following behaviors
> with different versions of NMS:
> 
> 1.0: The listener would fire most of the time when the connection was lost
> (sometimes it wouldn't, which initiated the search for a fix)
> 1.1: The process would deadlock within NMS code when the connection was lost
> 1.2-RC2: No event is fired when the connection is lost
> 
> With 1.2-RC2, I can close the TCP connection used by my publishers and
> subscribers, yet the ExceptionListener callback is never invoked.  I am
> curious if this is expected behavior and whether there is anything that can
> be done to reliabily detect connection failures?

I'd need some more information on your setup to give you a definite
answer.  Are you using the Failover transport?  If so then the exception
listener is not notified if the connection is dropped, the Failover
transport just sits in the background attempting to reconnect.

In NMS.ActiveMQ 1.2.0-RC2 there is an Inactivity Monitor in the
transport stack that can be enabled, its new and still undergoing some
testing so I have disabled it by default, you can enable it by adding
transport.useInactivityMonitor to your connection URI's options, like
this:

	"tcp://127.0.0.1:61616?transport.useInactivityMonitor=true"

For the non-Failover transport case when the TCP connection is broken
and finally detected it should cause an exception to fire from the
Exception listener.  Note however that without the inactivity monitor
enabled it could take some time for that to happen, I think the keep
alive on TCP connections in windows is something like an hour or so.

Regards
Tim.




Mime
View raw message