Question

Why only can java provide support for failover protocol in activemq whereas not other languages. My doubt is that in the failover protocol like failover://(tcp://host1:61616,tcp://host2:61616)?randomize=false also the client uses one of the the inner urls like tcp://host1:61616 and then how does the broker comes to know that the call was using some failover protocol or not and then how the broker decides that it needs to replicate the message ?

Was it helpful?

Solution

Please understand that failover protocol is meant for reconnect logic on client side only and AMQ broker isn't even aware if a client is using failover protocol or not.

From the official AMQ documentation:

The Failover transport layers reconnect logic on top of any of the other transports.

The Failover configuration syntax allows you to specify any number of composite uris. The Failover transport randomly chooses one of the composite URI and attempts to establish a connection to it. If it does not succeed or if it subsequently fails, a new connection is established to one of the other uris in the list.

Not sure what you mean by replication here but as per the official doc

The Failover transport tracks transactions by default. The inflight transactions are replayed on reconnection.

OTHER TIPS

There are different scenarios to put up a HA solution with ActiveMQ.

If clients connect using the failover protocol to host1,host2, then the broker setup needs to be setup for HA as well.

One solution is to cluster host1 and host2 in an Active-Active solution. Then messages are always propagated when they are asked for - the queues are shared in the entire cluster among all amq brokers.

Otherwise, if the active-active solution is not prefered, then a master-slave solution can be setup where the two brokers, host1 and host2, share the data area (for instance using a Database for persistance or a shared SAN disk).

There are more combinations of setups, but the failover protocol assumes that the entire solution can handle that messages arrives to different brokers, if one goes down. As far as I know, there is no other magic in the failover protocol, from the broker perspective.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top