The SDK supports either fully transparent or automatic failover in a number of situations.
When the SDK reconnects, entities obtained from the project are no longer valid. This includes publishers, subscribers, message readers/writers, and row readers/writers. After reconnecting, recreate these objects from the project.
In direct access mode, the SDK does not monitor the cluster for restarts. If a communication error occurs, the project object and all project-related entities are invalidated. Close the project, which also closes any elements it contains, then create a new project object and reconnect. The following example shows one way of doing this:
// Encountered communication error project.close(); Project project = s_sdk.getProject(uri, creds); project.connect(WAIT_TIME_60000_MS); // will succeed if cluster has restarted project. // Create publisher or subscriber and proceed