Gianluca Finocchiaro 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:
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:
{'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