Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jul 2008
    Location
    Bedminster
    Posts
    4

    having problem while subscribing pairs

    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_HELLOWORLD 1");
    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");

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    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.

 

 

Similar Threads

  1. Subscribing to multiple items
    By ablock in forum Client SDKs
    Replies: 1
    Last Post: May 2nd, 2012, 01:56 PM
  2. Problem re-subscribing
    By colmfield in forum Client SDKs
    Replies: 5
    Last Post: July 13th, 2010, 03:37 PM
  3. Subscribing to the Table
    By AidasOzelis in forum Client SDKs
    Replies: 13
    Last Post: June 3rd, 2010, 02:13 PM

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 04:26 AM.