Search code examples
replicationmessageactivemq-classicfailoverbroker

Apache ActiveMQ Failover Protocol


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 ?


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.