Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Oct 2006
    Location
    Zagreb
    Posts
    2

    How to reinitialize RobustNetworkedDataProvider?

    Hi,

    we are switching to ARI. On Lightstreamer side we use RobustNetworkedDataProvider and on application side we have implemented counterpart adapters/provides. COMMAND mode is used to push data.
    When connection between Lightstremer and application server breaks (e.g. due to application restart), LS correctly reloads new NetworkedDataProvider and waits on ports.
    Newly created NetworkedDataProvider is loaded with "state" of old (shut down) provider. When application connects to LS, new provider sends all subscribe requests. Application sends all "active" command records (ADD) and we get warning for each ADD: "Item already contains the key xxx.".

    Problem is that remote data provider does not know which items is cached in LS when it starts. Hence, it cannot issue DELETE commands to delete old data. Another (minor) problem is these warnings.

    I'd like RobustNetworkedDataProvider not to reload newly created NetworkedDataProvider with state of its predecessor, rather to start it as if LS server was restarted. That would create short break in data feed on client side but since that happens rarely it is acceptable.
    Is there some configuration parameter so that RobustNetworkedDataProvider behaves this way? I tried setting events_recovery to both leave_hole and use_snapshot with no difference.

    Regards,
    Zoran Perak

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Indeed, the RobustNetworkedDataProvider faces the worst consequence of a Remote Data Adapter crash (i.e. prevents the Server from closing), but at the cost of possible inconsistencies in the data flow.
    The inconsistency may be accepted for items in MERGE mode, but usually not for items in COMMAND mode.
    As documented in the sample adapters.xml provided, neither with the "leave_hole" nor with the "use_snapshot" policy can the missed "DELETE" event be recovered. The latter policy, at least, allows you to recover the missing "ADD" and "UPDATE" events at the cost of some warning messages.

    In order to recover those cases fully, a far more sophisticated implementation of RobustNetworkedDataProvider would be needed, such that it could keep the state of the COMMAND mode items it supplies.
    In fact, the RobustNetworkedDataProvider does not keep the state of any item: the state is only kept internally by Lightstreamer.

    As an alternative, your new Remote Data Adapter could, at startup, try to recall, in some way, the state of the item at the time the old instance failed, so as to send the old state as the snapshot and all the deltas as the first updates;
    "leave_hole" should be configured for this case, as the RobustNetworkedDataProvider should consider the snapshot as redundant.

    If recovering the old state of the item is not possible on the backend side (as in your case), you could still try asking for the state to the Lightstreamer Server instance itself, by opening a session and subscribing to the item, then waiting for the snapshot until the "End Of Snapshot" signal is received.
    Note that this would be far simpler with the Presto or Vivace edition, which supplies various kinds of client libraries.

  3. #3
    Member
    Join Date
    Oct 2006
    Location
    Zagreb
    Posts
    2
    Dario, thank you for clarification. I've forgot that item cache is in the server, not in the data provider.

 

 

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 05:46 PM.