Results 1 to 9 of 9

Hybrid View

  1. #1
    Senior Member
    Join Date
    Sep 2008
    Location
    rmd
    Posts
    30

    data not coming to web client

    INCOMING DATA for D~D --> {t=-1.0, h=-1.0, vo=-1, mi=-1.0, lst=null, P=-1.0, status=0, l=-1.0, c=0.0, sl=D, e=D, q=-1, lt=-1.0, dc=1, bq=-1, pg=0.0, ap=-1.0, bb=-1.0}
    03-Feb-09 11:13:15,906 |DEBUG|LightstreamerLogger.subscriptions|Simple updates queue |Manager: com.lightstreamer.c.kb@149105b
    03-Feb-09 11:13:15,906 |WARN |LightstreamerLogger.preprocessor |Simple updates queue |Unexpected snapshot event for MERGE item D~D
    03-Feb-09 11:13:15,906 |TRACE|LightstreamerLogger.pump |PUMP POOLED THREAD 2 |Pumping event in session S425f52b86927c020T1220500: d(2,1,3,"","","","","","","-1","","","-1","-1.0","","","null");
    03-Feb-09 11:13:15,906 |TRACE|LightstreamerLogger.push |PUMP POOLED THREAD 2 |RELEASING DATA --> <script>d(2,1,3,"","","","","","","-1","","","-1","-1.0","","","null");</script>

    My web client does not receive any value in the onItemUpdate event. Can this be caused by my web client or my MetaAdapter. My Data Adapter implements DataProvider and I use update(itemName, currentValue, isSnapshot) is called in onEvent. In both snapshot requierd and not required settings this happens.

    Thanks

  2. #2
    Senior Member
    Join Date
    Sep 2008
    Location
    rmd
    Posts
    30

    Angry

    I'm trying to find where the actual error is. Is it my web client or my LS server.
    According to LS log it seems that it releases correct data. But it is not available at webclient. onItemUpdate it returns null values when any subscribed field is called by getNewValue(). Who actually drops it? is it my client or my server. Can you please let me know the last place it should be available on my server side and the first place it is available on my webclient?

  3. #3
    Senior Member
    Join Date
    Sep 2008
    Location
    rmd
    Posts
    30

    Unhappy rolling back to basics

    //temp
    document.getElementById("testnon").innerHTML = "STREAMING";

    var ntable = new NonVisualTable("item1 item2", "bid_quantity", "MERGE");
    ntable.setDataAdapter("QUOTE_ADAPTER");
    ntable.setSnapshotRequired(true);
    pushPage.addTable(ntable, "nstocks");
    ntable.onItemUpdate = function(itemIndex,update,itemName){
    //alert(update.getNewValue("bid_quantity"));
    document.getElementById("testnon").innerHTML = update.getNewValue("bid_quantity");

    }
    It seems that I've messed some basics. I wonder why this is not working in Basic Stock-List Demo web client using demo adapter. [i'm using a trial vivace]

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    973
    May you please report a longer log snippet, starting from the actual subscription?
    Moreover, the client code shown is not consistent with the data flow reported in the log, because item names and field names don't match, unless your Metadata Adapter changes them. I mean that that Server log snippet cannot be originated by that client code.
    Anyway, if your goal is to attach your demo Data Adapter with the Basic Stock-List Demo front-end, then you must ensure that the item names and field names requested by the front-end and the ones supplied by the Data Adapter match.

  5. #5
    Senior Member
    Join Date
    Sep 2008
    Location
    rmd
    Posts
    30

    recreate the issue

    I'm going to go from the basics...

    I created a simple web client that uses a nonvisual table.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html>

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Lightstreamer :: Basic Stock-List Demo</title>
    <link rel="stylesheet" type="text/css" href="css/table.css" />

    <!-- load Lightstreamer libraries -->
    <script src="ls/lscommons.js" type="text/javascript"></script>
    <script src="ls/lspushpage.js" type="text/javascript"></script>
    </head>

    <body>
    <table width="766" border="0">
    <tr>
    <td><a href="http://www.lightstreamer.com" target="_blank">
    <img src="images/logo.gif" alt="LIGHTSTREAMER" hspace="0" border="0" /></a></td>
    <td class="demoTitle">demo basic</td>
    </tr>
    </table>

    <br />

    <div id="test2">This is a test</div>
    <div id="testnon">--</div>
    <script type="text/javascript">


    //////////////// Master Push-Page Configuration

    var pushPage = new PushPage();
    pushPage.context.setDebugAlertsOnClientError(true) ; // (set false in production)
    pushPage.context.setDomain()// (set the domain when deploying on web server)

    pushPage.onEngineCreation = function(lsEngine) {
    lsEngine.context.setDebugAlertsOnClientError(true) ; // (set false in production)
    lsEngine.connection.setLSHost(null); // (set the hostname when deploying on web server)
    lsEngine.connection.setLSPort(null); // (set the port when deploying on web server)
    lsEngine.connection.setAdapterName("MY_REAL_TIME") ;
    //lsEngine.policy.setMaxBandwidth(40); // ignored in Moderato and Allegro editions
    lsEngine.changeStatus("STREAMING");
    };

    pushPage.bind();
    pushPage.createEngine("MyCommonEngine", "ls/", "SHARE_SESSION", true);
    // both group and schema need to be defined by the backend
    var nvTable = new NonVisualTable("a","b","MERGE");
    nvTable.setSnapshotRequired(true);
    nvTable.setRequestedMaxFrequency(1.0);
    nvTable.setDataAdapter("DEMO");
    pushPage.addTable(nvTable , "nlist");
    nvTable.onItemUpdate = function(itemIndex,update,itemName) {
    document.getElementById("testnon").innerHTML =update.getNewValue("last_price");

    }
    </script></body></html>
    My Meta adapter needs to determine both group and schema.
    package stocklist_demo.adapters;

    import com.lightstreamer.interfaces.metadata.*;

    /**
    * Created by IntelliJ IDEA.
    * User: admin
    * Date: Feb 5, 2009
    * Time: 5:25:10 PM
    * To change this template use File | Settings | File Templates.
    */
    public class MyMetaAdapter extends MetadataProviderAdapter {

    public String[] getItems(String user, String session, String id) throws ItemsException {
    //TODO return items depending on id
    return new String[] {"item1","item2","item3"};
    }

    public String[] getSchema(String user, String session, String groupId, String schema) throws ItemsException, SchemaException {
    //TODO return customized schema
    return new String[] {"last_price", "ref_price", "open_price"};
    }


    public void notifyUser(String user, String password,java.util.Map httpHeaders) throws AccessException, CreditsException {
    if (!authenticate(user, password)) {
    throw new AccessException("Unauthorized user");
    }

    }

    private boolean authenticate(String userName, String password){

    //do authentication here
    return true;
    }


    }
    I use the StockListDemo_DataAdapter as it is.

    My log looks like this.

  6. #6
    Senior Member
    Join Date
    Sep 2008
    Location
    rmd
    Posts
    30

    log -- continue---

    i've attached the log file

    Thanks
    Attached Files Attached Files

 

 

Similar Threads

  1. Please help to fetch data to client
    By phancongphuoc in forum Adapter APIs
    Replies: 1
    Last Post: December 16th, 2010, 07:57 AM
  2. Replies: 5
    Last Post: July 12th, 2010, 10:12 AM
  3. Client receive old data after some time.
    By mnenchev in forum General
    Replies: 3
    Last Post: November 25th, 2009, 02:27 PM
  4. Web client not receiving any data?
    By TonyRoberts in forum Client APIs
    Replies: 10
    Last Post: October 10th, 2007, 09:00 AM

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