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
<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>