Results 1 to 6 of 6
  1. #1

    Any options for running LS server?

    Sorry for such a noob question. I was just curious if it's possible to instantiate and run the LS server as part of an existing Java web application instead of through the executable/batch file as it's own server.

    I'm developing a web app that requires alerts, but I'd much rather use a solution that can be bundled and deployed with my existing .war instead of adding the step of requiring a separate installation on the server.

    Is this possible?

  2. #2
    So I downloaded the free version, created a new Java project just for testing, added all the jars as dependencies, and stuck this simple line in my class:

    LS.main(new String[]{"C:\\Lightstreamer\\conf\\lightstreamer_conf.xml" });

    Is this an acceptable or discouraged way to launch lightstreamer server?

  3. #3
    Senior Member
    Join Date
    Feb 2013
    Posts
    54
    Hi Turick,

    Actually the server was not designed with this usage in mind and is not a kind of usage Lightstreamer officially support, but you could give it a try.
    Conflicts with your code may arise because of Server side-effects and global references; perhaps, you could avoid them by playing with the classloaders.
    An other issue, as you already pointed out, is the fact that the Server needs to access the file system to gather its own configuration, and is it's not possible to inject the configuration in other ways.
    Last but not least, the server is meant to shutdown with the VM, and the cleanup is very rough, as it relies on the VM termination. So, it could be a problem if you need to restart the Lightstreamer server from within your application.
    Please, let us know the results of your efforts, since this is a topic that now and then comes up, and it will be probably a direction for future improvements.

    regards,
    Marco

  4. #4
    Thanks Marco,

    This is probably a poor solution for a couple of reasons. 1) it still requires an additional (non-80) port on the server and 2) it's blocking, the container never knows that it's been fully deployed and unless it's started in a new thread, it makes the app hang.

    Lightstreamer seems like the best way to go in every way... except this. I'm not sure how you would handle the paid versions, but it would be awesome if I could just include Lighstreamer as a dependency in my pom file, and have the server run as a servlet that's a part of my existing web app on the same port. My group is currently discussing whether or not we want to have to manage another server just for ls or go with another solution (probably cometd).

  5. #5
    Senior Member
    Join Date
    Feb 2013
    Posts
    54
    Hi Turick


    I understand, in some cases, having all embedded in the same servlet container is simpler and has its advantages, but a dedicated server for push has some strong points it's worthy to take into account, like: stream-sense, data optimization, conflation, dynamic throttling, delta delivery and more.
    Stream-sense allowed automatic and fast detection of the best transport protocol on a per-client basis.
    To optimize message frequency, series of updates to an item can be filtered via queuing, resampling and conflation.
    The data flow may be dynamically throttled, based on the bandwidth allocation, the frequency allocation and the current real bandwidth detection.
    In order to spare even more bandwidth, for subsequent updates to an item, with delta delivery, only the actually changed fields may be sent.
    You may found more information on these slides, on "Lightstreamer General Concepts" and at http://www.lightstreamer.com/doc


    Regards,
    Marco

  6. #6
    Good points, and these are noteworthy benefits. It is something we'll have to take into consideration.

    Just a thought... maybe it would be beneficial to offer a lite version that doesn't include those benefits but allows the basic push capabilities inside a web app for smaller projects? Either way, lightstreamer is definitely an impressive product and I appreciate the info.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 06:32 AM.