Skip to Content
avatar image
Former Member

SUP: Multiple Servers to connect to at run-time?

Hello, I am using following code to register and synchronize my app by a SUP server:






Application app = Application.getInstance();




SUP101DB.registerCallbackHandler(new CustomerDBCallback());




SUP101DB.setApplication(app);




SUP101DB.getSynchronizationProfile().setServerName(SELECTED_SUP_SERVER);






ConnectionProperties connProps = app.getConnectionProperties();




LoginCredentials loginCredentials = new LoginCredentials(USERNAME, PASSWORD);






connProps.setLoginCredentials(loginCredentials);




connProps.setServerName(SELECTED_SUP_SERVER);




connProps.setPortNumber(PORT);






if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {





app.registerApplication(TIMEOUT);




} else {





app.startConnection(TIMEOUT);




}






if (!SUP101DB.isSynchronized("default") && app.getRegistrationStatus() == RegistrationStatus.REGISTERED) {





SUP101DB.disableChangeLog();





SUP101DB.synchronize(); // Initial Synchronize







SynchronizationGroup sg = SUP101DB.getSynchronizationGroup("default");





sg.setEnableSIS(true);





sg.save();





SUP101DB.synchronize();




}




SUP101DB.enableChangeLog();

If the server is running, it connects ok, however if I run this code once and the connection is not established (e.g., selected server is down) I choose another server (at run-time, the app doesn't restart) and run the same code again against a server which is 100% online - I am still not able to connect!

Probably there are some variables which must be cleared? Can someone provide a solution as to how to select SUP servers (connect to them, but not simultaneously just switch to another one, if necessary, register app, etc.) at run-time? Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jul 25, 2012 at 10:02 AM

    Do I understand correctly, that you want to register dynamically with different SUP servers?

    Well, I think that does not make sense as you do need to setup your application on the SUP server first, right?

    So the idea of SUP is to have an SUP cluster with some kind of load balancer up front (e..g a RelayServer) and that you setup your app on the server cluster. So in this concept you do not have the need to point to a different SUP server.

    The internals of SUP also prohibit you from connecting to different SUP server instances (if they are not part of the same SUP cluster) for security reasons. Each SUP server comes with a unique key that the application pulls and uses from then on. Once the key is in the app, you can not point this app to a different SUP server any more as you will get a key missmatch.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Any error messages, any details? This sounds very strange. Make sure you are using the right tutorial when running SUP 2.1.3 - that brings up the questions:

      • What is your SUP version?
      • What it the device you are using?
  • avatar image
    Former Member
    Aug 22, 2013 at 08:09 AM

    Tell me please, where can I get this key file for connection to SUP server?

    Add comment
    10|10000 characters needed characters exceeded