I am implementing a LightStreamer client in an angular1 service. Here is a subscribe function within the service
service.do_subscription = function(mode,itemList,fieldList,timescale,callback) {
require(["Subscription"], function (Subscription) {
var subscription = new Subscription(
mode,
itemList, // e.g. {"MARKET:IX.D.FTSE.DAILY.IP","MARKET:MT.D.GC.MONTH1.IP"}
fieldList // e.g. {"BID", "OFFER"}
);
// Set up Lightstreamer event listener
subscription.addListener({
onSubscription: function () {
console.log('subscribed to ', symbol, timescale);
_eventQueue.send('ig_subscription_successful',
{symbol: symbol, timescale: timescale});
},
onUnsubscription: function () {
console.log('unsubscribed from ', symbol, timescale);
},
onSubscriptionError: function (code, message) {
console.log('subscription failure: ' + code + " message: " + message);
},
onItemUpdate: function (updateInfo) {
results = {symbol: symbol, timescale: timescale};
// Lightstreamer published some data
var epic = updateInfo.getItemName().split(":")[1];
updateInfo.forEachField(function (fieldName, fieldPos, value) {
results[fieldName] = value;
//console.log(epic, fieldPos, 'Field: ' + fieldName + " Value: " + value);
// Alternatively, if the field is JSON, such as in a confirm message:
// var confirm = JSON.parse(value);
// console.log('json: ' + confirm.dealId)
});
callback(results);
},
onCommandSecondLevelItemLostUpdates: function(lostUpdates, key) {console.log('onCommandSecondLevelItemLostUpdates',lostUpdates, key)},
onCommandSecondLevelSubscriptionError: function(code, message, key) {console.log('onCommandSecondLevelSubscriptionError',code, message, key)},
onItemLostUpdates: function(itemName, itemPos, lostUpdates) {console.log('onItemLostUpdates',itemName, itemPos, lostUpdates)},
onListenEnd: function(subscription) {console.log('onListenEnd',subscription)},
onListenStart: function(subscription) {console.log('onListenStart',subscription)}
});
console.log('subscribing to ', mode, itemList, fieldList,timescale);
// Subscribe to Lightstreamer
service.lsClient.subscribe(subscription);
});
};
Here is the ouptput of the logger at info level
info: 63 {serverAddress redacted }
WARN: 411 {}
info: 63 {user redacted }
info: 63 {password [...] }
info: 401 {}
info: 412 {default149 true }
info: 424 {}
Lightstreamer client - start listening
info: 294 {}
info: 377 {}
info: 165 {[|SessionWS|false|false|1|0|3200|1|0|||false|false|] }
info: 294 {}
Lightstreamer connection status:CONNECTING
info: 350 {[object Object] }
info: 73 {}
info: 288 {[|ControlConnectionHandler|IDLE||50000|] }
info: 166 {[|SessionWS|false|false|4|3|3203|2|0|See7ebaafc5cf3 27bT4116359|[|WebSocketConnection|false|3201||true|]|false|false|] }
WARN: 246 {}
Lightstreamer connection status:CONNECTED:STREAM-SENSING
Lightstreamer property change: sessionId
Lightstreamer property change: serverSocketName
Lightstreamer property change: serverInstanceAddress
Lightstreamer property change: keepaliveMillis
Lightstreamer connection status:CONNECTED:WS-STREAMING
Lightstreamer connected subscribing to tick
subscribing to DISTINCT CHART:IX.D.FTSE.DAILY.IP:TICK ["BID", "OFR", "LTP", "UTM", "LTV", "TTV"] tick
info: 87 {[|Subscription|1|0||0||] }
info: 440 {[|Subscription|5|0|1|1|2|] }
onListenStart r {Yh: d, Gt: false, ld: "DISTINCT", Af: e, zf: null…}
info: 289 {[|ControlConnectionHandler|IDLE||50000|] [object Object] }
info: 293 {}
info: 294 {}
info: 441 {[|Subscription|4|0|1|2|2|] }
as you can see from the log the only event happening is onListenStart
When debug is enabled the log after the subscribing to DISTINCT line looks like this
info: 87 {[|Subscription|1|0||0||] }
449 {[|Subscription|5|0|1|1|2|] }
info: 440 {[|Subscription|5|0|1|1|2|] }
444 {[|Subscription|2|0|1|2|2|] }
89 {}
onListenStart r {Yh: d, Gt: false, ld: "DISTINCT", Af: e, zf: null…}
135 {}
90 {}
445 {[|Subscription|3|0|1|2|2|] }
91 {}
info: 289 {[|ControlConnectionHandler|IDLE||50000|] [object Object] }
271 {[|ControlRequestBatch|1|0|] 1 [|ControlRequest|1|1|false|[object Object]|] }
279 {}
304 {true [|ControlConnectionHandler|IDLE||50000|] }
305 {add [|ControlConnectionHandler|STAND BY||50000|] }
307 {}
309 {}
310 {}
271 {[|ControlRequestBatch|1|0|] 1 [|ControlRequest|1|1|false|[object Object]|] }
279 {}
148 {control }
info: 293 {}
448 {[|Subscription|3|0|1|2|2|] }
305 {async.limit [|ControlConnectionHandler|STAND BY||50000|] }
307 {}
info: 294 {}
299 {}
150 {bw(0.0);
}
332 {}
333 {1 }
257 {1 }
179 {0 }
64 {[LightstreamerEngine] maxBandwidth 0 }
65 {maxBandwidth 0 }
64 {[|LightstreamerClient|1|5|2|] maxBandwidth 0 }
150 {c(6,15,1,1,6,-1,-1);setWin(1,15);
}
332 {}
333 {1 }
257 {1 }
368 {1 1 6 0 0 }
info: 441 {[|Subscription|4|0|1|2|2|] }
150 {n(1,1);d(1,1,'#','#','#','#','#','#');
}
332 {}
333 {1 }
257 {1 }
358 {[object Arguments] }
257 {1 }
354 {( {1 1 NULL NULL NULL NULL NULL NULL }) }
150 {p();
}
332 {}
333 {1 }
257 {1 }
181 {}
150 {y(6);
d(1,1,3,'1480333128636','1',1);
}
332 {}
333 {1 }
257 {0 }
257 {1 }
354 {( {1 1 * * * 1480333128636 1 * }) }
150 {d(1,1,'6797.9','6798.9',1,'1480333129532','#',1);
}
332 {}
333 {1 }
257 {1 }
354 {( {1 1 6797.9 6798.9 * 1480333129532 NULL * }) }
150 {d(1,1,'6797.7','6798.7',1,'1480333131733',2);
}
332 {}
333 {1 }
257 {1 }
354 {( {1 1 6797.7 6798.7 * 1480333131733 * * }) }
150 {d(1,1,'6797.9','6798.9',1,'1480333132214','1',1);
}
So it looks like the data is coming down the pipe.
Any help greatly appreciated
Is there a document to convert the log message numbers to meaningful words ?
best regards
damian