Use shared store (either shared file system or jdbc) master slave, have the producers/consumers use a failover url containing both brokers.
The tricky part is having the consumers revert to host1 after failover recovery. This requires a reconnect so the consumers should periodically disconnect. One solution requires the use for a connection pool, having the pool drop idle connections can help but ideally a pooled connections lifetime can be restricted. There is an open issue for this, you can add your vote. see: https://issues.apache.org/activemq/browse/AMQ-2376 On 20 June 2010 15:48, rakeshxp <rakes...@gmail.com> wrote: > > Hi, > > I have a configuration query regarding use of failovers in activemq. My > current setup is that: > 1) I have 2 hosts running activemq with the second host intended to be a > failover > 2) On the primary host, I have multiple publishers ( to a single queue ) > and > a single consumer reading that queue. > > I am looking to setting up the failover activemq on host2 with the > following > requirement: > 1) The publishers ( using java client ) should continue to write messages > to > the queue on host1 ( and if host1 is down, write it to host2). > 2) The consumer ( using java client ) should read the messages in the queue > of host1 and if down, read from host2. > 3) When host1 is back online, the consumer should be start reading from > host1 again ( after processing any pending messages on host2). > > Could anyone guide me on what is the right configuration ( activemq.xml and > java connect url ) to achieve the same? What is the ideal way to solve the > host failure case? > > Thanks in advance! > - Rakesh > -- > View this message in context: > http://old.nabble.com/Configuration-for-failover-tp28941021p28941021.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- http://blog.garytully.com Open Source Integration http://fusesource.com