Failover
Sometimes the counterparty may be out of service, so the session cannot be connected.
If there is a backup counterparty server then there are the following options to implement the failover:
- Analyze exceptions that are thrown by the LogonAsInitiator(string, int, int, bool, IMessage, bool) method. For example, if there are LinkErrorException or LogonReplyTimeoutException exceptions, then this can be considered as a reason to connect to the backup server.
- Use the Sessions Scheduler component and specify the backup server via the Counterparties property. The scheduler will automatically connect to this server in case of the connection failure to the primary server.