Results 1 to 4 of 4

Hybrid View

  1. #1

    .NET Adapter Design and Javascript Subscription with Lightstreamer

    I want to use Lightstreamer for its push technology. I have a database in SQL Server and I am only familiar with .NET. That is why I need to write the adapter using VS for feeding data to lightstreamer using. I currently face a case as explained.


    I have table design in the database as below:


    TableA
    (Code, Name)
    (A0001, NameA1)
    (A0002, NameA2)
    (A0003, NameA3)




    TableB
    (Code, TableACode, TableDCode, Name, TableDCode, IsActive, Field1, Field2, Field3,...)
    (B0001, A0001, D0001, NameB1, D0001, True, B1F1, B1F2, B1F3)
    (B0002, A0001, D0002, NameB2, D0001, True, B2F1, B2F2, B2F3)
    (B0003, A0001, D0003, NameB3, D0002, True, B3F1, B3F2, B3F3)
    (B0004, A0002, D0001, NameB4, D0002, True, B4F1, B4F2, B4F3)
    (B0005, A0002, D0002, NameB5, D0003, True, B5F1, B5F2, B5F3)
    (B0006, A0003, D0003, NameB6, D0003, True, B6F1, B6F2, B6F3)
    (B0007, A0003, D0001, NameB7, D0003, True, B7F1, B7F2, B7F3)




    TableUserView
    (Username, TableBCode)
    (User0001, B0002)
    (User0001, B0003)
    (User0001, B0001)
    (User0001, B0007)
    (User0002, B0004)
    (User0002, B0005)
    (User0002, B0006)
    (User0002, B0007)




    TableD
    (Code, Name)
    (D0001, NameD1)
    (D0002, NameD2)
    (D0003, NameD3)


    TableA has approx 50 rows, TableB has approx 10000 rows, TableD has only 3 rows.


    I want to make a page in the old .NET webapp using Lightstreamer. The page shows TableB with Field1,2,3,...etc and the view in each user page is based on user in TableUserView. Field1,Field2,Field3,...etc is updated frequently and every update is pushed to the client browser. If I delete (User0002,B0004) and (User0001,B0001) in TableUserView, B0001 and B0004 will be unsubscribed automatically in the User0001 and User0002 page respectively. Then if I add (User0003, B0004) and (User0003, B0001) in TableUserView, User0003 will automatically get B0001 and B0004 subscribed in his page. Then if TableB[Code=B0007].IsActive is set to false, both User0001 and User0002 will unsubscribed B0007. There are 1000 users in the system access TableB simultaneously, so each user may have different view based on TableUserView.


    Based on the information above, how can I design the adapters in .NET and how is the subscription design in Javascript? Can I use Portfolio example for this case? In Javascript, FieldsLevel1 use COMMAND mode subscription with subscriptionID is username and FieldsLevel2 use MERGE mode subscription with each subscription corresponds to each TableB Code, is it OK? Actually is there any maximum number of subscriptions considering that too many subscriptions will make LS performance becomes poor? And suppose B0006 has already been unsubscribe from LS because there is no user subscribe it anymore, will B0006 be destroyed in LightStreamer Server? I notice that a new subscription is created at the first time, but it will never be destroyed after unsubscription.
    Because TableB has 10000 rows, may I split them for 3 data adapters based on TableDCode (3 rows) and each data adapter has many workers (threads), each worker collects TableB rows with the same TableACode? Note that each user is only allowed to view TableB rows with the same TableDCode.


    Sorry for the messy information and questions.




    Regards,


    Justin

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    Hello Justin, I confirm that the Portfolio Demo could be a suitable starting point.
    You could provide a "personal" item in COMMAND mode for each user, which carries the user related subset of TableUserView.
    Then, at a second level, you could provide an item for each row in TableB;
    these items may be subscribed to by multiple users.

    The overload of each item depends mainly on the related update activity;
    in principle, 10000 items are not expected to pose any problems.
    The unsubscription is also not a problem; when the last client unsubscribes, the Server is supposed to send "unsubscribe" to the Data Adapter and discard any memory associated to the item.
    If you notice anything different, please provide us with more details.

    The use of multiple Data Adapters was made available to manage subsets of items of different sources;
    we didn't think of it as a mean of distributing the load among multiple Data Adapter instances.
    If you feel you need to do this, consider that the Data Adapter instance is part of each subscription, hence the client application, when subscribing to the user-related items, should already know or be informed of which Data Adapter is involved.

  3. #3
    I have created a Data Adapter.It is perfectly connecting with Server and i have created a webclient which is successfully connecting to my Data Adapter but when i am connecting it to a Grid Stock Sample then it is not connecting.Please help me so that i can proceed.I am sending souurce code link http://winserver2008.serveftp.com/Code.rar

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

    If I am correct you're trying to feed the client located in the "StockApp" folder with the adapter that I find in the folder "MarketDataFeeder".
    In this case you should adjust the names of the Adapter Set and Data Adapter with those defined in the file "adapters.xml.", in your case "MarketDataFeeder" for Adapter Set while the Data Adapter name was not defined so "DEFAULT" is assumed.

    Thus, the JavaScript code needs these changes:



    and


 

 

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 05:10 PM.