JMS Examples: Application-Layer Failover
Presented as an example, this should be reworked as a concept, and potentially a task: 11.1.1. Application-Layer Failover HornetQ also supports Application-Layer failover, useful in the case that replication is not enabled on the server side. With Application-Layer failover, it's up to the application to register a JMS ExceptionListener with HornetQ which will be called by HornetQ in the event that connection failure is detected. The code in the ExceptionListener then recreates the JMS connection, session, etc on another node and the application can continue. Application-layer failover is an alternative approach to High Availability (HA). Application-layer failover differs from automatic failover in that some client side coding is required in order to implement this. Also, with Application-layer failover, since the old session object dies and a new one is created, any uncommitted work in the old session will be lost, and any unacknowledged messages might be redelivered.