Results 1 to 10 of 10
  1. #1
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41

    Restart Lightstreamer Server while browser open !!

    Hi everybody.
    I have a problem, and i wish you can help me solve it.
    My problem is that, when i restart the Lightstreamer server, and i have a web page opened in the browser, not all the data will be sent to it.
    And even if i close the page, or the browser, and reopen them, the problem still persist.

    So Can you tell me please what's wrong ??

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    You should ensure that, upon restart of the page, all the subscriptions are reissued as expected
    and that, upon the new subscriptions, all updates are produced by the Data Adapter as expected.
    The above can be checked against the Server log,
    after setting the LightstreamerLogger.subscriptions category at DEBUG level.

  3. #3
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    I restarted the server, while the web page still open.
    That's what i get when i set the LightstreamerLogger.subscriptions to DEBUG (for 2 items):
    20-avr.-10 08:30:42,390 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 5 |Subrequest 4: LS_session=S377ad60e993b3c7dT3041968&LS_window=14& LS_win_phase=6&LS_op=add&LS_req_phase=50&LS_mode1= MERGE&LS_id1=itemXXXXXX%20itemYYYYYY% .....LS_data_adapter1=QUOTE_ADAPTER&LS_snapshot1=t rue&LS_requested_max_frequency1=1&LS_unique=10 from 127.0.0.1:2563
    *************************************************
    And i have also these 2 lines for both 2 items:
    20-avr.-10 08:30:42,406 |TRACE|LightstreamerLogger.subscriptions|SERVER POOLED THREAD 5 |Subscribing to item itemXXXXXXon STOCKLISTDEMO.QUOTE_ADAPTER
    20-avr.-10 08:30:42,406 |TRACE|LightstreamerLogger.subscriptions|SERVER POOLED THREAD 2 |Subscribing to item itemYYYYYYon STOCKLISTDEMO.QUOTE_ADAPTER
    ************************************************** ****
    but only this line for the first item:
    08:30:54,562 |TRACE|LightstreamerLogger.subscriptions|Simple updates queue |INCOMING DATA for itemXXXXXX--> {ask_nb1=., last_price=., open_price=...etc.}
    I didn't find this line for the other item.

    Can you tell me what's wrong ?
    And thnx !!

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    hi,

    I see that you're using an old client build, I suggest you to upgrade to the new one.

    about the issue, if you don't see the "INCOMING DATA" log for the second item, it means that the server does not receive anything from the data adapter for such item.
    So, is the used adapter custom made or is it our adapter?

    I see that the first "INCOMING" log is "INCOMING DATA" and not "INCOMING SNAPSOHT". Is it possible that your data adapter does not handle the first snapshot?

    can you debug the data adapter to check that it actually doesn't send any update to Lightstreamer kernel for itemYYYY when it is first subscribed?

  5. #5
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    Sorry for bothering you again, but here's the senario:
    i modified the DataAdapter of the StockListDemo so i can use it. But instead of having random (static) data, i read data from a data feed.

    So while data are being added to the stockGenerators variable (for example, with only itemXXXXXX ), i open the web page, and that item will be shown in the browser.
    i close the web page, or browser.

    Now, the item itemYYYYYY will be added, i open the web page, and that item will not be shown in the browser. only the first item will be.

    I also noticed something else. if i close the web page for a moment (i think 1 minute or 2), all the data will be shown. So i think that the problem is related with sessions.

    i hope that you'll help me

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    I think that the problem is related to the initial snapshot

    when your data adapter receives a subscribe call for an item you have to give to the server a snapshot of the current values for that item so that it can send them to the client.
    I think that's what is missing in your adapter

    If you check our original adapter you'll see this call in the subscribe implementation

    that call makes the feed simulator send a snapshot with the initial values for the subscribed item.

    let me nknow if you have any doubt

  7. #7
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    I already got that. In fact, i didin't modify that code at all. I used it as it is:
    Code:
        public void subscribe(String itemName, boolean needsIterator)
                throws SubscriptionException {
            if (needsIterator) {
            }
            if (itemName.startsWith("item")) {
                synchronized (subscribedItems) {
                    subscribedItems.put(itemName, new Boolean(false));
                }
                myFeed.sendCurrentValues(itemName);
            } else {
                throw new SubscriptionException("Unexpected item: " + itemName);
            }
        }
    I'm still debugging...I will keep you informed

  8. #8
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    As i said before, the data are being added to the stockGenerators variable (it takes some times), so when the subscribe function is called, it will not send anything to Lightstreamer server (because that item is not found "yet" in stockGenerators variable), so myFeed.sendCurrentValues(itemName); will return nothing. That's why data will not be shown in the browser.
    I think it will be shown only when you refresh the session (after you close the browser, and wait a while).
    Is there a solution to call the subscribe function when you refresh the page ? Or is there a way when you close the browser or page, you kill the session ( so i don't have to wait some time before the session get killed) ?

  9. #9
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Is there a solution to call the subscribe function when you refresh the page?
    No, there isn't, the subscribe method for a certain item on the data adapter is called when such item is subscribed by a client for the first time while the unsubscribe call for the same item is called when the last client subscribed to that item closes its session (or explicitly unsubscribes from the item).
    eg: admitting a just started server, if a clients subscribes to itemX then subscribe for itemX is called on the adapter, but if a second client subscribes to itemX too the subscribe method is not called again. After that, even if the first client closes its session, the unsubscribe for itemX is not called because the second client is still subscribed.

    So you can't govern the subscribe/unsubscribe call through a client as other clients may interferer.

    The solution to your issue would be to track the subscribed items so that when stockGenerators is filled for the first time, if an item is already subscribed, you will be able to send the updates to the server as soon as them are available, so that the server in turn will send them to the connected clients.

    HTH

  10. #10
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    Thank you very much Mone

 

 

Similar Threads

  1. LS Flex Client is stalled on restart of LS server
    By pratik in forum Client SDKs
    Replies: 4
    Last Post: June 26th, 2015, 09:56 AM
  2. Replies: 6
    Last Post: December 7th, 2010, 10:26 AM
  3. Replies: 1
    Last Post: January 18th, 2010, 04:27 PM
  4. Replies: 3
    Last Post: September 29th, 2009, 09:54 AM
  5. Updates dropped when restart is performed
    By ctranfd in forum Client SDKs
    Replies: 3
    Last Post: June 5th, 2009, 12:45 PM

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 09:40 AM.