You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by SndMndBdy <ad...@alliancebernstein.com> on 2006/08/01 15:01:23 UTC

No Exception When All Servers in Failover Fail

Hi,

When a client listens on a TCP transport for messages, it receives a
java.net.SocketException when the server goes down.  When listening on a
failover transport to two TCP transports (ie
"failover://(tcp://serverA:61616,tcp://serverB:61616)?randomize=false"),
even if both servers go down, no exception is thrown to the client.  Is this
the intended behavior?  If so, is there any way for me to have the client
receive an exception if all of the servers in a failover transport go down?

Thanks,
-Adam
-- 
View this message in context: http://www.nabble.com/No-Exception-When-All-Servers-in-Failover-Fail-tf2033417.html#a5593990
Sent from the ActiveMQ - User forum at Nabble.com.


Re: No Exception When All Servers in Failover Fail

Posted by James Strachan <ja...@gmail.com>.
On 8/1/06, SndMndBdy <ad...@alliancebernstein.com> wrote:
>
> The trouble with the transport listener is that I only get alerted when a
> server goes up or down - you don't know which server it was or which were
> originally up when you connected.  The best possible test you could have
> here is when you get a TransportInterrupted, if you don't get a
> TransportResumed within a few seconds, throw the error.

In that case you could just plug in your own TransportListener to do
that. i.e. if the transport is down for more than X seconds then both
servers must be down etc.


> I am looking for a purely informational exception, so I think
> extending/altering the FailoverTransport is probably the best way to go,
> although I was hoping to not have to do this.

If you submit a patch to put in whatever hooks you want we could
include it in the distro...
http://incubator.apache.org/activemq/contributing.html

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: No Exception When All Servers in Failover Fail

Posted by SndMndBdy <ad...@alliancebernstein.com>.
The trouble with the transport listener is that I only get alerted when a
server goes up or down - you don't know which server it was or which were
originally up when you connected.  The best possible test you could have
here is when you get a TransportInterrupted, if you don't get a
TransportResumed within a few seconds, throw the error.

I am looking for a purely informational exception, so I think
extending/altering the FailoverTransport is probably the best way to go,
although I was hoping to not have to do this.
-- 
View this message in context: http://www.nabble.com/No-Exception-When-All-Servers-in-Failover-Fail-tf2033417.html#a5594938
Sent from the ActiveMQ - User forum at Nabble.com.


Re: No Exception When All Servers in Failover Fail

Posted by James Strachan <ja...@gmail.com>.
On 8/1/06, SndMndBdy <ad...@alliancebernstein.com> wrote:
>
> Hi,
>
> When a client listens on a TCP transport for messages, it receives a
> java.net.SocketException when the server goes down.  When listening on a
> failover transport to two TCP transports (ie
> "failover://(tcp://serverA:61616,tcp://serverB:61616)?randomize=false"),
> even if both servers go down, no exception is thrown to the client.  Is this
> the intended behavior?

Yes. You can also add a TransportListener to an ActiveMQConnection to
know when exceptions occur or when the transport is suspended/resumed

>  If so, is there any way for me to have the client
> receive an exception if all of the servers in a failover transport go down?

Not easily no. You could just make the transport fail after connecting
N times to all available servers - that would do what you need?

If its purely informational notifications you are after a little
refactoring of the FailoverTransport could generate events to indicate
all servers are temporarily unavailable.


-- 

James
-------
http://radio.weblogs.com/0112098/