Skip to content

Failover

This page explains how to configure JMS Bridge for failover, enabling seamless transition between a live server and a backup server. This configuration ensures high availability and reliability in message processing, allowing the system to automatically switch to a backup server in case of a primary (live) server failure. The configuration can be applied in environments using Virtual Machines (VMs) or Docker containers.

  1. Install JMS Bridge on two virtual machines: one configured as the live server and the other as the backup server.

  2. Add the following properties on both VM’s broker.xml file:

    <ha-policy>
    <shared-store>
    <master>
    <failover-on-shutdown>true</failover-on-shutdown>
    </master>
    </shared-store>
    </ha-policy>
    <!-- Connectors -->
    <connectors>
    <connector name="live-netty-connector">tcp://<<live-jms-bridge-host>>:61616</connector>
    <connector name="backup-netty-connector">tcp://<<backup-jms-bridge-host>>:61616</connector>
    </connectors>
    <cluster-connections>
    <cluster-connection name="my-cluster">
    <connector-ref>live-netty-connector</connector-ref>
    <static-connectors>
    <connector-ref>backup-netty-connector</connector-ref>
    </static-connectors>
    </cluster-connection>
    </cluster-connections>
  3. Start the broker on the Live VM first.

    • Wait 30–40 seconds after starting the broker, then verify successful startup by checking the logs/jms-bridge.out file for the message: Server is now live.
  4. Then start broker on the backup VM.

    • Wait 30–40 seconds after starting the broker, then verify successful startup by checking the logs/jms-bridge.out file for the message: Backup announced.
  5. If the live server fails, the backup server automatically transitions to the live state. Confirm this by checking the log message: Backup server is now live.

  6. When the live server restarts, the backup server returns to standby mode automatically.