Results 1 to 4 of 4
  1. #1

    Error handling for: [Unexpected update for item]

    I understand that LightStreamer drops updates to an item when there are no active subscriptions. LightStreamer logs these occurrences like so:

    WARN |LightstreamerLogger.subscriptions|Thread-7 |Unexpected update for item foo.bar

    I need to perform some logic when this occurs. I haven't been able to find how to handle this exception in the API. I would appreciate someone pointing me in the right direction.

    Thanks!

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

    Actually, when the are no more active subscription, the Lightstreamer Server notifies the Data Adapter on the unsubscribe method.
    The Data Adapter is supposed to stop sending updates for this item. Any subsequent update sent by the Data Adapter for the unsubscribed item will be just discarded by the server. (see the update or the smartUpdatye methods in the ItemEventListener interface).
    In other words, is up to the Data Adapter to track which item is not subscribed anymore by the Lightstreamer Server and avoid to send updates for it, but take the required action in case.

    cheers
    Marco

  3. #3
    Thank you for your reply.

    You said the item "will be just discarded by the server". I want to override that. I am using ItemEventListener.update() but no where in the ItemEventListener API does it list a way to do this or catch the error. Unless I am missing something...

    The only solution it seems, (and I think you mentioned) is to manually track subscriptions with subscribe/unsubscribe and manually check them before each call of listener.update().

    Do I have it correct?



    Quote Originally Posted by marco.testa View Post
    Hi Tony,

    Actually, when the are no more active subscription, the Lightstreamer Server notifies the Data Adapter on the unsubscribe method.
    The Data Adapter is supposed to stop sending updates for this item. Any subsequent update sent by the Data Adapter for the unsubscribed item will be just discarded by the server. (see the update or the smartUpdatye methods in the ItemEventListener interface).
    In other words, is up to the Data Adapter to track which item is not subscribed anymore by the Lightstreamer Server and avoid to send updates for it, but take the required action in case.

    cheers
    Marco

  4. #4
    Senior Member
    Join Date
    Feb 2013
    Posts
    54
    Yes, you are correct:
    it's up to the Data Adapter to manually track subscriptions with subscribe/unsubscribe and manually check them before each call of listener.update()

    cheers
    Marco

 

 

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 08:34 AM.