rekhender
Hi,
I'm using a .NET adapter which connects to our rates Manager for live feed of rates. Everything seems to work fine, except a weird behavior of LightStreamer server. The page which calls the server sends in (lets say) 10 different pairs to subscribe. But when i see my adapter, some of the pairs seem to never reach my adapter. Can you explain me why would that happen. And then server starts throwing exceptions, that those pairs are being timed out. Also some how the first pair in the list never reaches the adapter to get subscribed.
Following is the code snippet attached:
Subscribe code snippet
Public Sub Subscribe(ByVal itemName As String) Implements IDataProvider.Subscribe
SyncLock _ratesCollection.SyncRoot
Dim product As String = Replace(itemName, "_", "/")
If _ratesCollection.Contains(product) Then
Dim e As Rate = _ratesCollection(product)
Dim eventData As IDictionary = New Hashtable()
eventData("Product") = e.Product
eventData("Bid") = e.Bid
eventData("Ask") = e.Ask
eventData("High") = e.High
eventData("Low") = e.Low
eventData("Close") = e.Close
eventData("BidChange") = e.BidChange.ToString
eventData("AskChange") = e.AskChange.ToString
eventData("CloseChange") = e.ClosingChange.ToString
_listener.Update(itemName, eventData, False)
End If
End SyncLock
Console.WriteLine(_count & ". Subscribing: - " + itemName)
End Sub
In this you can see, I do a console write line to see what all pairs have come for subscription, and can see that pairs seems to be missing. the server is never able to send all the pairs for subscription. I'm very confused on what I'm a doing wrong.
Client Code: -
var page = new PushPage();
var _engine;
page.onEngineCreation = function(engine) {
_engine = engine;
engine.connection.setLSHost("localhost");
engine.policy.setPollingInterval(1000);
engine.connection.setLSPort(8080);
engine.connection.setAdapterName("PROXY_HELLOWORLD1");
engine.changeStatus("STREAMING");
}
page.bind();
page.createEngine("HelloWorldApp", "LS", "SHARE_SESSION");
var group = new Array("EUR_USD", "USD_JPY", "USD_CHF", "GBP_USD");
var schema = new Array("Product", "Bid", "Ask", "High", "Low","BidChange", "AskChange")
var pushtable = new OverwriteTable(group, schema, "MERGE");
pushtable.setRequestedMaxFrequency(0.5);
pushtable.onChangingValues = formatValues;
page.addTable(pushtable, "hellotable");
Dario Crivelli
I assume that "pair", in Lightstreamer terms, stands for an "item" representing a foreign exchange.
If your main problem is that the subscriptions to some items encounter timeout exceptions, the simplest way to provide us with evidence of this is by analyzing the Proxy Adapter log.
Please, show us a Server log after setting the priority for the "com.lightstreamer.adapters.remote" category to DEBUG.
Anyway, in order to ensure that the subscription requests don't reach the "Subscribe" call, please issue a console write line also at the beginning of the method.