Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jan 2010
    Location
    Austin
    Posts
    1

    Newbie Java Remote Adapter question

    I'm creating a remote adapter in java and confused by the UD3 message.

    It seems to me that it requires the java program to remember all the unique ID's that have been sent to it so that the program can append it to the ud3 message correctly. To me, it's not very scalable when millions of users connecting at the same time.

    I'm not sure if I'm missing something but is there a way to broadcast all the change to all the user who are currently subscribing to a particular item without knowing their original request id. Any help is greatly appreciated

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    958
    The unique ID of the subscription request is not related with the user.
    Requests from multiple users for the same item only cause one subscription request to be issued to the Remote Data Adapter, as you would expect.
    Hence, at any time, there is at most one subscription in place for each item.

    However, depending on the user activity, it is possible that an item is subscribed to and unsubscribed from for multiple times in sequence.
    In order to distinguish these subscription instances, we introduced this unique ID.
    Hence, the ID is redundant (the item name would be enough), but if you managed subsequent subscription requests for the same item through independent threads,
    the ID would be helpful in avoiding conflicts between these threads without the need of a careful synchronization between them.

  3. #3
    Hi,

    Just for a better understanding of the issue, assuming I have an item AAPL, what would be a best practice to remove the item when no subscribers for this item any more?
    for example would a ConcurentHashMap<ItemNameString, CounterInteger> subscriptions... would be a good way to go?

    Thanks,

    Gal

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    503
    Hi Gal,

    Please note that you do not need to keep track of the number of users subscribed to an item only for purpose of remove it when there are not any more, this is a task already performed by Lightstreamer server.

    When there are no more users subscribed to a specific item the server will send an Unsubscribe (USB) message to to your adapter, and faced with this message, you can remove the item.

    Hope that helps.

 

 

Similar Threads

  1. Hello World Remote Socket Adapter
    By kclerc in forum Adapter Protocol
    Replies: 7
    Last Post: April 12th, 2010, 12:40 PM
  2. Replies: 1
    Last Post: May 21st, 2009, 10:41 AM
  3. Replies: 4
    Last Post: February 5th, 2009, 12:45 AM
  4. Replies: 0
    Last Post: January 10th, 2007, 05:03 PM
  5. LightStreamer and Sockets - newbie question
    By jsharpe in forum Adapter APIs
    Replies: 3
    Last Post: September 28th, 2006, 03:03 PM

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:59 PM.