activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: NMS not listening properly to Connection Interrupted and Connection
Date Tue, 26 Jan 2010 18:45:29 GMT
On Tue, 2010-01-26 at 07:50 -0800, Tammer Salem wrote:
> Hello All,
> I've successfully written a .NET Compact Framework client that can send and
> receive messages using the new NMS Stomp packages (Excellent work!)
> 
> I'm now trying to cater for dropped connections. The application will have
> to receive messages, even if it has to recover from communication failures
> (3G/GPRS connection interruptions). Therefore I've used two methods
> 
> ConnectionInterruptedListener
> ConnectionResumedListener
> 
> The ConnectionInterruptedListener should pick up a lost connection where I
> gracefully tidy up a couple of things. Then I use ConnectionResumedListener
> to re-establish a connection with activemq.
> 
> The strange thing is that none of these listeners are working when I cut the
> connection. Currently I'm doing this in the Pocket PC WM5.0 emulator by
> switching off the network connectivity from the emulator (not gracefully).
> When I restart the connection the appropriate listener does not fire, and of
> course I've lost connection to activemq, but neither the server or the
> consumer is aware of this.
> 
> Any ideas?

The NMS.Stomp client doesn't have any sort of Failover transport so
these events aren't hooked up to anything.  When the connection is
broken you should see an event fired to a registered ExceptionListener.
The ConnectionInterrupted and ConnectionResumed events are for
Connections that are managed and can be reconnected internally, they
give your client notice that there isn't a connection so your send might
block, etc.

Regards
Tim.


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message