Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40

    Light streamer control filter parameters programatically

    Hi,
    I have some questions about my LS integration.
    Here is my case:
    I receive string messages in given format (stock ticks) over TCP process running in jboss. From there i send the messages to JMS topic(like the ls jms demo). The messages are send to my LS adapter and subscribed clients receive the messages(ticks) for real time pricing that is calculated on the client with gwt code. The message coming from the tcp are for N stock markets. So if i have 20 markets and 20 tick per second for market i send 20*20 messages to the LS adapter(the market count and messages per second are varaibles but let say 20 and 10 are the defaults). I send all the messages to the adapter using jms topic. The client can subscribe for one market at a time. So one client will receive 20 messages max.
    What i'm asking is is:
    1) Is it bad idea to send all messages to the adapter with jms topic? Is it possible to overflow the topic? Should i implement some custom logic to filter the messages amount before sending them to the adapter or LS can handle this? It also depends with the topic!
    2) It possible programmatically to control the messages sent to the client?
    Regards!

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    972
    We know of an implementation in which a single topic carries updates for a set of items and JMS selectors are used by the Data Adapter in order to extract from the topic only the currently subscribed items.
    And that message rate is not smaller than yours.
    However, the performance may depend on the specific JMS implementation.
    Note that a topic guarantees the order of the messages and packing all the items in the same topic causes the inter-item message ordering to be maintained;
    this is an unneeded effort, as then Lightstreamer only guarantees intra-item message ordering.

    Lightstreamer can handle a 400 messages per second inbound traffic on normal machines. However, if you can accept a filtered flow on your clients and want to ensure maximim scalability, it could be beneficial filtering the flow at the origin.
    Note that you don't need to put a filter before JMS or in the Data Adapter, but you can rather take advantage of the Preprocessor (see this FAQ for an introduction).
    But consider that the filtering only works at item level. It is not clear to me if a "market" corresponds to an item or to multiple items. If your 20 updates per second for a market are broadly distributed among a large number of items, no filtering is possible.

    May you please clarify your second question?
    Do you refer to configuring filtering? Or to refusing subscriptions? Or to discarding events? Or to sending user-specific events?
    Or to something else?

  3. #3
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40
    Hi,

    Excuse me for my bad explanation. Every market has unique id and is an item for example USD/EUR is item54 and each item has 3 properties (you call it schema?) that are updated in NonVisualTable, the property names are short_tick, long_tick and ivol.
    One client can subscribe to one market at a time for example item54. And client browser will receive ivol messages and one of the others(the criteria which is made by the client as he moves some slider - we discussed this before). As for the backend implementation we create one topic for each market(item) that was added to the subscribed list.

    As for my second question, i want when the user moves the slider and the event decides that the client should receive short_ticks i want to send also 1 long_tick per second in order to cover the time of subscribe/unsubscribe (when the user move the slider again).
    I some cases i also want to decrease the updates send to the client. Is it possible the client(understand client side) to tell "i want 3 updates for that property per sec"?

  4. #4
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40
    OK, i think i found proper sollution for the first question.
    I will have 2*market items one item for short_tick and one for long_tick. I tested the subscribe/unsubscribe and subscription seems to work fast enough, unsubscribtion is a little slow but i don't care about that . In that way i will send only needed data.

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    972
    It seems to me that you also solved the second question and no more answers are needed.
    I confirm that the only way to dynamically change the frequency of a single item on a single client page is through a resubscription.
    If the update frequency were your only concern, the resubscription technique would also allow you to use the same item and subscribe to it with a different frequency limit.

  6. #6
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40
    Hi, yes, i managed to do exactly what i wanted, and i am using subscription/unsubscription on my onSliderChange() event. It works perfectly and surprisingly very quickly(less than a second to switch feeds). Also i am going to add additional item - "configuration" that will be updated rarely with configuration messages for my slider logic i.e. on what value the slider must switch feeds .
    The only problem with ls is that i can't subscribe to two different adapters, but that is in my(demo) jms implementation logic, that will be investigated some moment in the future .
    Regards & tnx for the help.

 

 

Similar Threads

  1. Could not connect to light streamer server
    By bponnappan in forum Adapter APIs
    Replies: 1
    Last Post: July 5th, 2012, 09:38 AM
  2. connect Light streamer and j2EE web application
    By pradeepgamage in forum Adapter APIs
    Replies: 7
    Last Post: May 17th, 2012, 09:21 AM
  3. How does lightstreamer do the filter?
    By gengliangyu2008 in forum Adapter APIs
    Replies: 5
    Last Post: November 26th, 2010, 09:00 AM
  4. problems: DB connection,parameters,groups
    By naitsir in forum Adapter APIs
    Replies: 13
    Last Post: October 14th, 2009, 04:53 PM
  5. filter/query
    By jamesclinton in forum Client APIs
    Replies: 2
    Last Post: April 16th, 2007, 12:54 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 08:50 PM.