Skip to main content
August 10, 2011
Question

Is there any way to get an application to load automatically on server start?

  • August 10, 2011
  • 1 reply
  • 658 views

We're trying to implement a load-balancing mechanism between FMS hosts in a virtual "farm".  The mechanism we're using is to have the FMSs periodically send "load" data (along with a timestamp) to an application server.  That server will then use that load information and timestamp to detect when an FMS server has gone down and to make stream assignments to FMSs.

Right now, I've implemented this code via a setInterval() in live/main.asc.  I've added a "return false" to Application.onAppStop() to (according to the docs, I haven't tested this yet) keep the server from shutting down an idle instance.  So I've left with a "chicken and egg" issue: how do I get the interval running before the first request hits the application (and forces the load of the application)?  I've tried putting the setInterval in onAppStart() and as a global.  In both cases, it only gets executed after application is loaded.

So, is there any way to force an application to load (via a config file parameter or local command-line)?

    This topic has been closed for replies.

    1 reply

    Nikhil_Kalyan
    Participating Frequently
    August 11, 2011

    Hi,

    I am sorry i have not read the full details what you wrote, but if you are looking for loading of application on start of the server, there is a configuration tag in application.xml called loadonstartup and by default it is set to false. Set it to true to enable it and all the apps will be loaded on server start.

    alternatively , you can make an application.xml inside the application folder and set this tag to true, to have this applied only to a particular application,

    Also, the fms admin console can launch a new instance of an app without any connection being made initially.

    Thank you !

    August 11, 2011

    Thank you very much.  Exactly what I was looking for!