cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

D_Olderdissen
Advisor
Advisor
0 Kudos

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.

Former Member
0 Kudos

Hello, Dirk,

thanks for your replay! The problem is such that if i run the above code to connect to a SUP server and it doesn't yield a successful connection (e.g., if a wrong IP has been provided or used: 1.1.1.1, etc.) at the first run - then i can't connect to the SUP server during the second run even if i specify the correct IP.

I don't restart the application between the runs and there is no any relay server; the application is set up at the server, so if IP is correct at the first run - it can connect successfully. Currently i have only one SUP server, since it uses DHCP IP can change over time.

The question is how to reconnect if the first connection attempt has not succeeded? Thanks!

D_Olderdissen
Advisor
Advisor
0 Kudos

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?