Results 1 to 3 of 3
  1. #1

    Question Fields not included in some updates

    We have a stream a stream of trade actions being consumed by a client. In every 3-5 items streamed, there's a field value that is not received.

    Is there the possibility of this being connected to the client code? (please see below)

    I thought that if I replaced the NonVisualTable mode argument from MERGE to DISTINCT that I would get all fields but I must be missing something.

    Any suggestions please? Thanks

    Code:
    <script>
          var lightStreamerDomain = "lsdemo.cityindextest9.co.uk";
          var lightStreamerHost = "lsdemo.cityindextest9.co.uk";
          var lightStreamerPort = "8080";
          var lightStreamerDebug = "true";
          
          var authenticationInfo = null;
          
          
          function InitializeLightStreamEngine() {
              var adapterName = "MyAdapterSet";
    
    
              var pushPage = new PushPage();
              pushPage.onClientError = clientErrorHandler;
              pushPage.onServerDeny = serviceDeniedHandler;
              pushPage.context.setDebugAlertsOnClientError(lightStreamerDebug);
              pushPage.context.setDomain(lightStreamerDomain);
              pushPage.onEngineCreation = function (engine) {
                engine.connection.setAdapterName(adapterName);
                engine.context.setDebugAlertsOnClientError(lightStreamerDebug);
                engine.connection.setLSHost(lightStreamerHost);
                engine.connection.setLSPort(lightStreamerPort);
                engine.changeStatus("STREAMING");
    
    
                if (authenticationInfo != null) {
                  engine.connection.setUserName(authenticationInfo.Username);
                  engine.connection.setPassword(authenticationInfo.SessionId);
                }
              };
              pushPage.bind();
              pushPage.createEngine("ConnectEngine", "/LS", "SHARE_SESSION");
    
    
              return pushPage;
          }
          
          var pushPage = InitializeLightStreamEngine();
          var group = requestCollection;
          var table = new NonVisualTable(group, schema, "DISTINCT");
          table.setDataAdapter("TRADEACTION");
          table.setSnapshotRequired(true);
          var marketId = prompt("Market id to follow (cancel for all markets)");
          
          if(marketId) {
            table.setSelector("marketId=" + marketId);
            $("h1").append(" Market id " + marketId);
          }
          
          table.onItemUpdate = updateItemHandler;
          pushPage.addTable(table, "tradingActivityHomeTable");
          
          function updateItemHandler(item, updateInfo) {
            var li = $("<li></li>");
            li.hide();
            li.append("Trade action: <strong>" + updateInfo.getNewValue("TradeActionId") + "</strong> (" + new Date() + ")<br />");
            li.append("Screen name: " + updateInfo.getNewValue("ScreenName") + "<br />");
            li.append("Market name: " + updateInfo.getNewValue("MarketName") + "<br />");
            li.append("Market id:  <strong>" + updateInfo.getNewValue("MarketId") + "</strong><br />");
            li.append("Direction: " + updateInfo.getNewValue("Direction") + "<br />");
            li.append("Price: " + updateInfo.getNewValue("Price") + "<br />");
            $("#updates").prepend(li);
            li.slideDown('slow');
          }
      </script>

  2. #2
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    152
    Hi Fabricio,

    the version of library you are using is no more supported, so I strongly suggest to proceed with an upgrade: starting from version 6.0, the new JavaScript Client Library has replaced the old HTML Client Library with a brand new, fully redesigned, API and extended features. Here the complete changelog.

    MERGE and DISTINCT are not interchangeable subscription modes. Please refer to the General Concepts and to this thread to get a better understanding abut these topics

    In your snippet you always invoke the getNewValue method on updateInfo instance: instead you should use getOldValue if the value has not changed. You can test that by invoking the isValueChanged method.

    Please get back to us for any further clarifications.

    Thanks and Regards,
    Gianluca
    Last edited by gianluca.finocchiaro; January 15th, 2015 at 12:35 PM.

  3. #3
    I ended up finding out that the field sometimes missing was because there was a background process deleting that data...

    About the upgrade, I am afraid that's out of my hands. This will still have to go through many people before happening but thanks for the heads up.

    The links you provided were useful. Thanks

 

 

Similar Threads

  1. Replies: 1
    Last Post: July 24th, 2014, 04:03 PM
  2. How to get not received updates.
    By motya770 in forum General
    Replies: 4
    Last Post: April 3rd, 2013, 11:36 AM
  3. Replies: 2
    Last Post: May 15th, 2008, 10:25 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:32 AM.