File-Based GMD Considerations


If you plan to use file-based GMD, you can control the resending of spooled GMD messages. You can force all spooled GMD messages to be resent, or you can prevent them from being resent by deleting them from the spool.

Resending GMD Messages

When a Java RTclient comes up and a connection is made to RTserver, the Java SmartSockets class library automatically resends any GMD messages that are stored on disk. This automatic sending of messages ensures that if a Java RTclient crashed and then came back up, any messages that were not acknowledged by a GMD_ACK, and are still in the GMD spool area, are automatically resent.

To force all spooled GMD messages to be resent, invoke the method TipcSrv.gmdResend. This method must be invoked after the connection to RTserver is established. For RTserver connections, this is done automatically once the connection to RTserver is established.

Removing GMD Files

To prevent the SmartSockets Java RTclient from resending spooled GMD messages when connecting to RTserver, invoke the method gmdFileDelete from RTclient. You must invoke gmdFileDelete before the connection to RTserver is established, but after the unique subject has been set. For example:

public class test { 
    public static void main(String[] args) { 
    TipcSrv srv; 
 
    try { 
      // load options file, which must have value for 
      // ss.unique_subject 
      Tut.loadOptionsFile("test.cm"); 
 
      // get server instance 
      srv = TipcSvc.getSrv(); 
 
      // remove GMD files from spool area 
      srv.gmdFileDelete(); 
 
      // connect to server, which would normally resend any 
      // unacknowledged messages from the GMD spool area, if  
      // present 
      srv.create(); 
      
      // continue processing... 
    } 
    catch (Exception e) { 
      System.out.println(“Caught exception “ + e); 
      System.out.println(e.printStackTrace()); 
      return; 
    } 
  } 
} 

TIBCO SmartSockets™ Java Library User’s Guide and Tutorial
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com