Results 1 to 6 of 6
  1. #1

    Question Snapshot in Remote Data Adapter

    Hi,

    We've implemented ARI protocol in Java quite successfully so far, but now I think we're missing something.

    How will remote Data Adapter know if client requested a snapshot if there's no isSnapshotAvailable() method call from LS kernel? Should I just send a snapshot on first subscribe() call, no matter if client requested it or not? Also, should I just start sending isSnapshot = false updates if my Data Adapter actually doesn't support snapshots for the specified item? If so, what is the purpose of isSnapshotAvailable() method on DataProvider interface anyway (non ARI implementation)?

    Tnx,
    Dejan

  2. #2
    Senior Member
    Join Date
    Feb 2013
    Posts
    54
    Hi Dejan,

    The snapshot to be sent to the client is actually managed by the Lightstreamer Server. It is the responsibility of the Server to maintain the snapshot for a given Item and to send it to the client when a client subscribes to an Item, requiring the snapshot.
    The server in turn expects to receive the snapshot from the Data Adapter only the first time it subscribes to a given item on the Data Adapter, and this happens the first time a Client subscribes to the Item.
    For all the following clients subscribing to the same Item, the server sends directly the snapshot, which already retains, to the client, without expecting anything from the Adapter.
    The server keeps the snapshot while at least one client is subscribed to the item. When also the last client unsubscribes the Item, the Server in turns unsubscribes the Item from the Data Adapter and discards the snapshot. The next client subscribing to the same item will cause again the Server to subscribe to the Data Adapter and to expect the snapshot.
    When the Server subscribes an Item to the Data Adapter, the Data Adapter may send ItemUpdates with the flag 'is snapshot', followed by the 'endOfSnapshot', or may send directly the 'endOfSnapshot' if no snapshot is available.
    After having received the 'endOfSnapshot', the Server expects every following itemUpdate for the same Item not to be flagged as 'isSnapshot'.
    If the Data Adapter is not able to send the snapshot for any Item, after any subscription it should send immediately the 'endOfSnashot', otherwise, in case of a not-remote Data Adapter it may return 'false' from the 'isSnapshotAvailabe' method. In the later case the Server doesn't even expect to receive the 'endOfSnapshot'.
    Due to the round trip, for the server there is actually no advantage to ask 'isSnapshotAvailable' to a Remote Data Adapter, and the Server always expects to receive a 'endOfSnapshot' from a Remote Data Adapter. So, a Remote Data Adapter must always send an End Of Snapshot to the Proxy Adapter during the subscription of the item, even if the snapshot for an item is not available.

    hth,
    Marco

  3. #3
    Tnx Marco, this clears up everything.

    Docs should definitely be updated.

    BR,
    Dejan

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    Hi Dejan,

    Would you be so kind to suggest us where you would like to see more details in the documentation of the ARI protocol? Your feedback is precious.

    Thanks,
    Alessandro

  5. #5
    Hi Alessandro,

    I'm using a pdf doc "Adapter Remoting Infrastructure - Network Protocol Specification", Last updated: 3/12/2012 as a reference.

    I'd add details about each method in chapters 2.4 and 2.5; especially important are the ones that differ from non ARI protocol (so their doc can't be found in Java API doc for DataProvider / MetadataProvider). Then, some kind of flow diagram for ARI should be shown, with explanation of the steps (e.g. something like in chapter 4.2 of the doc "General Concepts"), as it is not the same in ARI / non ARI implementations.

    BR,
    Dejan

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    Thanks Dejan!

 

 

Similar Threads

  1. Replies: 5
    Last Post: March 26th, 2019, 10:12 AM
  2. Newbie Java Remote Adapter question
    By webmons in forum Adapter SDKs
    Replies: 3
    Last Post: March 7th, 2013, 10:30 AM
  3. Hello World Remote Socket Adapter
    By kclerc in forum Adapter SDKs
    Replies: 7
    Last Post: April 12th, 2010, 12:40 PM
  4. Replies: 3
    Last Post: August 18th, 2008, 01:55 PM
  5. Pre-Processor Snapshot vs DataAdapter Snapshot
    By sukhdev in forum Adapter SDKs
    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 04:10 PM.