Results 1 to 10 of 80

Hybrid View

  1. #1
    Quote Originally Posted by gianluca.finocchiaro View Post
    Hi Mamoa,
    it can certainly work, but the LSClient should be left as a general purpose Lightstreamer Client, hence I believe that your proposed logic should be put somewhere else, because it catches a specific use case.

    Reconnection is a feature handled by other official Lightstreamer Client, by it is supposed that credentials do not change or, if they do, you have to write some custom logic to provide updated values.

    Please let me know if your reconnection proposal also involves handling of new session tokens.

    Thanks, Gianluca
    Hi Gianluca,

    Thanks for the reply. I have been very busy lately and I'm sorry that I didn't get back to you sooner. As you said, my case is really specific to my situation so it shouldn't be added to your lightstreamer client.
    To answer your question, yes, my logic requires handling new session tokens so actually I had to use another api client (Rest API from IG) to get reconnected and getting new sessions tokens.
    Finally I got it running (with a few custom modifications) but I'm having problems with a special case.

    IG Streaming API (https://labs.ig.com/streaming-api-reference) has a special case where you have a DISTINCT Mode subscription , with 1 Item (TRADE) and 1 Field (OPU) but within that field you have various elements. When I subscribe to this trade I see the following message printed by the LightStreamer Client:

    Code:
    Received update message ---> <1,1|{"stopLevel":1.74014,"trailingStopDistance":0,"limitLevel":null,"trailingStep":0,"currency":"CAD","expiry":"-",
    "guaranteedStop":false,"dealIdOrigin":"DIAAAABBHRQJLBA","direction":"SELL","epic":"CS.D.GBPCAD.MINI.IP",
    "dealId":"DIAAAABBHRQJLBA","dealReference":"GCMJXRBVSFD44TD","level":1.73414,"status":"OPEN","size":1,
    "channel":"PublicRestOTC","timestamp":"2017-05-26T07:23:21.000","dealStatus":"ACCEPTED"}>
    but in the table listener I get this message:

    Code:
    {'values': {'OPU': u'{"stopLevel":1.74014'}, 'pos': 1, 'name': 'TRADE:MCMVD'}
    As you can see, I only received the first element of the dict in the listener. I could make an adaptation for this case but I thought it could be positive to add this feature (multiple elements within the field) to your lightstreamer client. What do you think?

    Thanks again,
    Mamoa

  2. #2
    Power Member
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    161
    Hi Mamoa,

    thank you very much for this post, as you helped me find out a bug in the demo.
    Actually, the 'values' dict should have been looked like the following:

    Code:
    {'values': {'OPU':u'{"stopLevel":1.74014,"trailingStopDistance":0,"limitLevel":null,"trailingStep":0,"currency":"CAD","expiry":"-","guaranteedStop":false,"dealIdOrigin":"DIAAAABBHRQJLBA","direction":"SELL","epic":"CS.D.GBPCAD.MINI.IP","dealId":"DIAAAABBHRQJLBA","dealReference":"GCMJXRBVSFD44TD","level":1.73414,"status":"OPEN","size":1,"channel":"PublicRestOC","timestamp":"2017-05-26T07:23:21.000","dealStatus":"ACCEPTED"}', 'pos': 1, 'name': 'TRADE:MCMVD'}
    where the value associated with the 'OPU' key is a json string to be processed by your custom logic.
    I've just fixed the client on our github repository.

    Please let me know wheter it helps.

    Thanks and Regards.
    Gianluca

  3. #3
    Hi GianLuca,

    I tested the fixed client and now is working perfectly. Thank you very much!

    Regards,
    Mamoa

  4. #4
    Quote Originally Posted by gianluca.finocchiaro View Post

    Code:
    {'values': {'OPU':u'{"stopLevel":1.74014,"trailingStopDistance":0,"limitLevel":null,"trailingStep":0,"currency":"CAD","expiry":"-","guaranteedStop":false,"dealIdOrigin":"DIAAAABBHRQJLBA","direction":"SELL","epic":"CS.D.GBPCAD.MINI.IP","dealId":"DIAAAABBHRQJLBA","dealReference":"GCMJXRBVSFD44TD","level":1.73414,"status":"OPEN","size":1,"channel":"PublicRestOC","timestamp":"2017-05-26T07:23:21.000","dealStatus":"ACCEPTED"}', 'pos': 1, 'name': 'TRADE:MCMVD'}
    where the value associated with the 'OPU' key is a json string to be processed by your custom logic.
    I've just fixed the client on our github repository.

    Please let me know wheter it helps.

    Thanks and Regards.
    Gianluca
    This works like the magic for me as well. Thank you!

 

 

Similar Threads

  1. Python Client Library for Lightstreamer
    By Alessandro in forum Client SDKs
    Replies: 1
    Last Post: December 18th, 2014, 05:15 PM
  2. how to comunicate lightstreamer server by python
    By keyan in forum Client SDKs
    Replies: 4
    Last Post: December 18th, 2014, 05:12 PM
  3. Replies: 2
    Last Post: January 5th, 2012, 08:53 AM

Tags for this Thread

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 09:55 PM.