Hi,
Please consider using the Warm Standby Application Block is a reusable production-quality component that enables developers to switch to a backup server in case their primary server fails, without needing to guarantee the integrity of existing interactions. It has been designed using industry best practices and provided with source code, so it can be used "as is," extended, or tailored if you need to.
Example showing how to activate Warm Standby Application Block:
To activate the WarmStandby Application Block, you create, configure and start a WarmStandbyService object.
Two Endpoint objects must be defined: one with parameters for connecting to your primary server and one for connecting to your backup server.
You must also remember to start the WarmStandbyService before opening the protocol.
[Java]
Endpoint tserverEndpoint = new Endpoint("T-Server", TSERVER_HOST, TSERVER_PORT, tserverConfig);
Endpoint tserverBackupEndpoint = new Endpoint("T-Server", TSERVER_BACKUP_HOST, TSERVER_BACKUP_PORT, tserverConfig);
TServerProtocol tserverProtocol = new TServerProtocol(tserverEndpoint);
WarmStandbyConfiguration warmStandbyConfig = new WarmStandbyConfiguration(tserverEndpoint, tserverBackupEndpoint); warmStandbyConfig.setTimeout(5000); warmStandbyConfig.setAttempts((short)2); WarmStandbyService warmStandby = new WarmStandbyService(tserverProtocol); warmStandby.applyConfiguration(warmStandbyConfig); warmStandby.start(); tserverProtocol.open();
The Warm Standby Application Block distribution consists of two main components:
The application block itself, which provides an interface that you can use to integrate it into different GUI applications and a sample WarmStandbyQuickStart application, which is built on the Warm Standby Application Block.
For more info please refer to Developer's Guide "Using the Warm Standby Application Block" chapter.
Roman T