Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Latest commit

 

History

History
33 lines (24 loc) · 1.83 KB

adding-a-new-high-availability-strategy.md

File metadata and controls

33 lines (24 loc) · 1.83 KB

Adding a new High Availability Strategy

Introducing a new High Availability (HA) strategy to provide HA support with the Message Broker can be done by adopting either of the following approaches:

Requirements

It is required that the new HA strategy implementations call the activate() and deactivate() methods of the HA Listeners registered to receive notifications on node state changes, when the node state changes from passive to active and active to passive, respectively.

HA strategies introduced by extending the AbstractHaStrategy class can notify the listeners registered by calling the notifyBecameActiveNode() and notifyBecamePassiveNode() methods in AbstractHaStrategy.

The default HA strategy, io.ballerina.messaging.broker.coordination.RdbmsHaStrategy, extends the AbstractHaStrategy class to provide HA support.

Using the new HA Strategy

With the custom HA strategy implemented, the following steps should be followed to utilize the new HA strategy.

  1. Copy the JAR file to the <MB_HOME>/lib directory
  2. Mark failover as enabled and specify the canonical name of the class implementing the HA strategy as the strategy in the broker.yaml configuration file along with the any custom parameters as options:
 enabled: true
 strategy: com.custom.failover.CustomHaStrategy
 options:
  heartbeatInterval: 3000