You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jlindwall <jl...@yahoo.com> on 2014/04/03 23:49:48 UTC

failover://tcp with updateClusterClients vs failover://(discovery)

== Short version ==

If we use failover with updateClusterClients, do all clients failover to the
*same* secondary broker?

server: 

       <networkConnectors>
          <networkConnector uri="multicast://default" />
        </networkConnectors>
         ...
        <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"
discoveryUri="multicast://default" 
updateClusterClients="true" />

client:  failover://tcp://primary:61616

Scenario:  Say we are running 3 brokers: primary, secondary, tertiary.  The
clients all initially connect to primary.  When primary goes down, I need
all client to failover to the same backup broker (either secondary or
tertiary).  Does this configuration guarantee this, or is it possible that
some clients could failover to secondary and some others to tertiary?

== Gruesome detail ==

In our environment we have all non-durable message topics.  There will be
100 consumer/producers connecting to 4 topics in the broker.

We want to enable failover so that if the current broker dies, all
connections switch-over to the *same* secondary broker.  We do not want have
a static failover list of broker urls but instead want some form of
discovery. We do not want to spread the load over N brokers, but rather run
N brokers that can be ready as hot backups for a failed primary (ie in-use
broker); to belabor the point: only one broker is in use at a time.

I first tried using the discovery transport:

client:  discovery:(multicast://default)?maxReconnectAttempts=10
server: <transportConnector name="default" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>

In this setup, some clients (even initially, let alone during failover)
would connect to various running brokers -- not all to the same.  I'm
assuming some client connections received the UDP broadcast in different
sequences.

Switching to a network of brokers, accessed using failover with
updateClusterClients:

server: 

       <networkConnectors>
          <networkConnector uri="multicast://default" />
        </networkConnectors>
         ...
        <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"
discoveryUri="multicast://default" 
updateClusterClients="true" />

client:  failover://tcp://primary:61616

It seems like all clients  failover in lockstep to the same secondary
broker.  At startup, of course, they all connect to the primary. This is
wonderful and is the behavior I need.  Looking in TransportConnector.java it
seems like the code loops through all client connections and sends each one
the same list of peer brokers... which again is exactly what I want.

I am looking for some confirmation that this observation is sound.  And if
not, then some advice on achieving my goal.

Thanks!






--
View this message in context: http://activemq.2283324.n4.nabble.com/failover-tcp-with-updateClusterClients-vs-failover-discovery-tp4680051.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.