You need to use master-slave setup for the server1 and server2 http://activemq.apache.org/masterslave.html
Regards -- Dejan Bosanac - http://twitter.com/dejanb ----------------- The experts in open source integration and messaging - http://fusesource.com ActiveMQ in Action - http://www.manning.com/snyder/ Blog - http://www.nighttale.net On Wed, Jan 11, 2012 at 1:22 AM, ksunilsingh <[email protected]> wrote: > We have a broker (let us call it Main Broker) running at tcp:// > 0.0.0.0:61616. > This broker does a store and forward message to a remote broker. To do > that, > we have a network connection from this broker to two remote brokers. We > want > one of the remote brokers to serve as primary and other as failover. This > is > the network connect URI that we are using > > static:(failover://(tcp://*server1*:61617,tcp://*server2*:61617)?randomize=false) > > We are using spring DefaultMessageListenerContainer to listen for the > messages > failover://(tcp://*server1*:61617,tcp://*server2*:61617)?randomize=false > > In the normal scenario when all the brokers are up and running and a > message > is sent to Main Broker, it is getting forwarded to server1 and is consumed > by the listener. > > If we stop the broker on server1, the fail over is happening successfully > and the messages are getting forwarded to server2 and successfully consumed > by the listener. The problem is when we bring the server1 back up, the > messages continue to be forwarded by the main broker to server2. Our > requirement is that once the server1 is up and running, the Main broker > should start forwarding the messages to server1 and the listener should > connect back to server1 and consume messages. We cannot change randomize to > true because we want only one of the servers1 or server2 to be active at a > time. > > Please let me know whether it is possible and how. > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Switching-back-to-the-primary-remote-broker-after-successful-failover-tp4283984p4283984.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >
