Results 1 to 7 of 7
  1. #1

    Lightbulb Maintaining snapshot in LS server with no clients subscribed

    Hi,

    We're working with LS using ARI protocol to feed data to it, implementing our own data provider of course.

    Great functionality is available in LS after first client subscribes to an item - LS keeps the snapshot of the item in memory, so when next client subscribes, LS simply feeds him the same snapshot without need to ask for it from DataAdapter (and of course in MERGE / COMMAND mode it nicely maintains the snapshot with updates received between the 2 subscriptions). However, this all disappears after all the clients unsubscribe. The next subscription after that will require the snapshot to be retrieved from DataAdapter again.

    We'd like to avoid recreating this snapshot maintenance mechanism on our side (since it already exists in LS), but just simply send the updates to LS from DataAdapter even if there are no clients subscribed. Is it possible to do it by implementing ARI data / metadata adapter subscription or session management methods in a different way?

    One ugly workaround (that we'd like to avoid) is simply keeping one useless client subscribed to the item all the time (originating from our server). Hope that we don't have to do that.

    Tnx,
    Dejan

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    505
    Hi Dejan,

    Your description of the scenario is very accurate, and I can confirm that our advice in this case is to cheat the Server by adding a fake client which subscribes to the needed items and never quits.
    Please note that your own data provider can act as a generic client, via the well documented HTTP-based network protocol, and implement the minimal functionalities to open (and eventually close) the subscription you want to make permanent in the server.
    Obviously this is only available if you have an "Allegro/Presto/ Vivace" edition with the "Generic Client" feature enabled. While, in case of "Moderato" edition, you should actually create a new mini-client in JavaScript (you could use node.js at server side).


    Some alternative exist, and are based on the leverage of some parameters of the server configuration. But these are considered private, and therefore not publicly documented, also because they impose severe drawbacks such that should be used with very care.

    Regards,
    Giuseppe

  3. #3
    Hi Giuseppe,

    Tnx for the reply. It is really strange that you don't support this option. Out of curiosity, why doesn't it exist as a normal function? I.e. DataAdapter telling the LS when to clear the snapshot. I'm assuming it can be extremely easy to add it. Are there plans to do it in some of the next versions?

    We're back to developing new functionalities, using DEMO mode. When we finish, we'll buy probably Alegro with Java (and few other clients) like we had before, so we'll make a Java client to circumvent this in the meantime.

    BR,
    Dejan

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    505
    Hi Dejan,

    Indeed the concept of "clear snapshot" was introduced recently in our Adapters Interface and allows the Data Provider to force, for a given Item, the cleaning of the snapshot maintained by the server (clearSnapshot).
    But this feature assumes that the items has yet subscribed and nothing can do in case the Item was unsubscribed (no more clients have active subscription for it). And this is why I think it is not useful in your case.

    I confirm you that we are already considering the possibility of extending the Adapters interface in order to add the feature you suggest but unfortunately I can not provide a definite schedule for its introduction.

    Thank you for your valuable tips.
    Giuseppe

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    515
    Hi Dejan,

    I confirm Lightstreamer is currently based on a "publish-on-demand" paradigm, but we will support "publish-always" too in the future.

    In the meanwhile, if you use the technique suggested by Giuseppe, you can make it extremely efficient by specifying a very very low update frequency for each "fake" subscription. This will make no actual data actually flow on the connection, while still keeping all the items subscribed too. Let us know if you need us to expand on this.

    Thanks,
    Alessandro

  6. #6
    i am using a ANGULAR client and can you help me understand it better on how to make a fake subscription and that with a low frequency updates only for that fake client alone..

    Any updates on Publish-Always paradigm !!!

    Thanks
    Rajesh

  7. #7
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    505
    Hi Rajesh,

    Regardless of the client technology used the idea of fake subscriptions consists of a client application that remains active and connected to the Lightstreamer server and subscribes all the Items for which you want a always ready snapshot.
    The client indeed does not need to consume the received updates so you can set a very low fequency for the subscriptions, for example with JavaScript API (setRequestedMaxFrequency):

    subscription.setRequestedMaxFrequency(0.001);

    the fake client will receive an update for Item every 1000 seconds.

    About the Publish-Always paradigm I can confirm that we are not there yet.

    Regards,
    Giuseppe

 

 

Similar Threads

  1. Replies: 1
    Last Post: April 17th, 2015, 10:59 AM
  2. Snapshot for subscribed items.
    By atejero in forum Adapter APIs
    Replies: 3
    Last Post: October 3rd, 2013, 04:08 PM
  3. Replies: 3
    Last Post: May 3rd, 2013, 10:26 AM
  4. Replies: 1
    Last Post: August 10th, 2010, 11:33 AM
  5. Pre-Processor Snapshot vs DataAdapter Snapshot
    By sukhdev in forum Adapter APIs
    Replies: 3
    Last Post: August 1st, 2007, 09:44 AM

Tags for this Thread

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 03:32 AM.