You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Tammer Salem <ta...@googlemail.com> on 2010/01/26 16:50:57 UTC

NMS not listening properly to Connection Interrupted and Connection

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?
-- 
View this message in context: http://old.nabble.com/NMS-not-listening-properly-to-Connection-Interrupted-and-Connection-tp27324812p27324812.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: NMS not listening properly to Connection Interrupted and Connection

Posted by Tammer Salem <ta...@googlemail.com>.
Got it - thanks!

I've now set-up an ExceptionListener and have been able to generate an
exception.

For anyone else interested - if you're using the emulator and simulate a
network failure by simply turning off the network in the emulator
configuration, an exception of System.IO.IOException is thrown.

regards,
Tammer

2010/1/26 Timothy Bish <ta...@gmail.com>

> 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/
>
>
>
>

Re: NMS not listening properly to Connection Interrupted and Connection

Posted by Timothy Bish <ta...@gmail.com>.
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/