fimmu
Hi, I find Lightstreamer could be a very nice tool for getting streaming stock quotes from my broker to my client application. The broker API is https based and allows upto 300 symbols/request. I try to follow the stocklist demo in the installation to make this work. I have a few confusions here:
1. In the adaptor implementation, there is a init function:
public void Init(IDictionary parameters, string configFile) {
_myFeed.SetFeedListener(this);
_myFeed.Start();
}
I am not sure who is listening to who here? My quest is the adaptor is listening to the data feed, correct me if I am wrong.
2. The stocklist demo uses generated data, one symbol at a time to do the event/update. (right?). If I want to get all quotes for all 300 symbols from my broker and stream all these to my client application, I think I have to process differently. Any suggestions as to the event handling? (I know I don't need the portion of code to generate fake quotes)
3. Is it possible to push quotes for all 300 symbols at once to my client application? If so, what should I do?
Thanks!
Giuseppe Corti
Hi fimmu,
1) In the implementation proposed in that example the class StockListDemoAdapter acts as a listener for the ExternalFeed. This one simulates the component that interfaces with the broker, or any other supplier of prices, and each time it is generated a fresh data calls the OnEvent method of StockListDemoAdapter.
2) Assuming that you keep the data logic with one Item for each symbol, the updates are passed from the Adapter to the Lighstreamer server via a call to Update method for each symbol.
How implementing the event handling depends on how you receive the updates from your broker, for example if they are received asynchronously or for example through synchronous requests.
3) Do you mean you want the updates for all the 300 symbols in the same message? I confirm that if each symbol is a different Item the updates for each of them are independently managed by the server and therefore can reach the client at different times.
You might consider grouping all the symbols in the same Item but this is not a practice generally recommended.
Please let me know if you need further clarifications.
Regards,
Giuseppe
fimmu
Hi, Giuseppe:
Thanks for answering my quesions! After some tries, I am getting close to having a .Net adaptor ready for testing.
To reduce network traffic, I bundle max of 100 symbols in each http request and then process the response one symbol at a time at local. I am about to do a testing by using a javascript client just to see if It gets the update. Before that, I am trying to run the .Net version of the Stock_list based on DotNet Adapters.pdf. After reading the instructions, I am still having a deployment issue which I will post to the deployment board for help
Best regards,
Dario Crivelli
Hi,
In the meantime, please clarify what you mean by "I bundle max of 100 symbols in each http request", so that we can understand if you are leveraging Lightstreamer in the best way.
Is this http request a way in which your adapter gets the data from the back-end feed?
Or do you refer to subscription requests issued by the client? The relation between items and http requests can be optimized by some client libraries.