Results 1 to 5 of 5
  1. #1

    Red face MarketDepth with data source from database

    Dear Forum,

    Would any body share to me the Market Depth Demo Data Adapter Example that use the data source from sql ? I tried to do it but the simulator package is so confusing for me to replace it with the database access.

    Thank you very much in advance,

    Mario

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi Mario,

    The market orders simulator assumes to receive all buy and sell orders for a stock and match them in order to generate the market executions.
    These orders can be generated by users through the demo client, but to generate more traffic the simulator creates orders randomly with different frequencies.

    Now, in your specific scenario, we need to understand if from your db the adapter will extract raw orders or data already processed, with buy and sell lists ready to display.
    In the former case you can mantain much of the structure of the adapter code.
    In the latter, you can greatly simplify the code but will depends on how the data of the feed tables are structured.

    Regards,
    Giuseppe

  3. #3
    Dear Mr Corti,

    Thank you very much for your kind reply.

    To simplify the code, the adapter will get the data that already processed. I prefer to provide the Query that can be executed by the Adapter to get the ready data.

    I will use the MarketDepth example as my basic idea of my application. The application is almost the same as the MarketDepth, that is, using the COMMAND mode. The application is the monitoring application that displays the monitoring result of 5 objects (as fields) with flexible number of item of testing (the rows). The adapter will push the data every 2 seconds.

    The data structure resulted by the query consists of 5 fields and flexible number of rows. Because of this flexible number of rows, the COMMAND mode is suitable for this application.

    Thank you very much in advance for your kind advice.

    Regards,

    Mario

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi Mario,

    I got it, thank you for the further details. So in your scenario you can give up all the simulator part of the demo code.
    Your adapter will simply need a thread that regularly queries the db; something not very different from what described here:

    http://forums.lightstreamer.com/show...a-Adapter-Java

    What is a bit more tricky is that you have to cross the query results with an image, maintained by the adapter, of the table in order to produce the single commands to be passed to Lightstreamer server.

    - A ADD command for a newly added row.
    - A DELETE command for a row eliminated from the db.
    - An UPDATE command for row with at least one changed field.

    However this should not be too hard to achieve at least if one of the fields already serves as a key for the row.

    Regards,
    Giuseppe

  5. #5
    Dear Mr. Corti,

    Thank you for your explanation. I will try your advice soon.

    Regards,

    Mario

 

 

Similar Threads

  1. Java SE client source code?
    By carenot in forum Client SDKs
    Replies: 4
    Last Post: March 18th, 2016, 09:33 AM
  2. Data source parsing problem
    By shabbirh in forum Client SDKs
    Replies: 2
    Last Post: September 28th, 2012, 11:00 AM
  3. Newbe: LightStreamer and WSDL source for Adapter
    By Dr.Dran in forum Adapter SDKs
    Replies: 0
    Last Post: April 27th, 2009, 03:53 PM
  4. Interaction demo source code
    By sarbao in forum General
    Replies: 1
    Last Post: April 16th, 2009, 09:59 AM
  5. How And Where To Specify Database As Data Feed?
    By devidasan in forum Adapter SDKs
    Replies: 1
    Last Post: March 17th, 2009, 12:00 PM

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 12:04 PM.