Failover support

To prevent a single point of failure, the Gateway Framework supports connecting multiple instances of an application of same identifier (application type and application id) with the same server (or server cluster).

Only one of the connected instances will be active, the rest will be passive. If the active instance terminates (which effectively closes the session of the instance), any one of the passive instance becomes active.

If currently, there is an active instance running, any passive instance started afterwards must be initialized with the same bootstrap configuration, and service configurations. This ensures that when that passive instance becomes active, it will initialize the same services as the previously active instance, and behave in a similar manner.

If an active instance is running in static mode, passive instances for the application must run with the same configuration.
If an active instance is running in dynamic mode, passive instances for the application must also run in dynamic mode - with the same value for gateway.config.auto-save-to-file bootstrap configuration.
When a passive instance running in dynamic mode becomes active, it will use the configuration persisted on the server to ensure that it’s using the same configuration as the previously active instance.