Remote Clients auto reconnect when all peer members disconnect from the cluster.

Remote Clients auto reconnect when all peer members disconnect from the cluster.

book

Article ID: KB0093840

calendar_today

Updated On:

Products Versions
TIBCO ActiveSpaces -
Not Applicable -

Description

Description:
How to address Remote Clients auto reconnect through an API when all the peer members disconnect from the cluster.

Symptoms:
Remote Client will throw the exception "remote_client_timed_out".
Cause:
Remote Client will trigger a connection timeout when no peer members are in the cluster.

Issue/Introduction

Remote Clients auto reconnect when all peer members disconnect from the cluster.

Resolution

As-Agents not available scenario for Java client.

 

Remote Client time_out set to 24 hours from the Java API.

 

1). If  as-gents(peer members) came online before the 24 hours time window, remote client reconnect code will work without issue.

 

2).  If as-gents (peer members) came online after the 24 hours time window, you need to restart the remote clients again. Since you have complete control over the AS Java API, you can write your own logic to handle this scenario.

 

======Pseudo Code ===========================

......Put / get activity

catch (ASException e){
            System.out.println(e);
           
            if(e.toString().contains("SYS_ERROR (remote_client_timed_out)"))  /// sample check
            {
             System.out.println("Metaspace  cleaned up...######################################");
             ("Closing All MS Connections");
              ms.closeAll();
              ms=null;
            }
============================================
Next AS call (put /get activity)

if(ms==null)
{
MemberDef memberDef = MemberDef.create();
memberDef.setDiscovery(discovery); // remote proxy node
ms = Metaspace.connect(metaspace, memberDef);

}

===========================================

Additional Information