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

    LS not sending all messages to client

    Hi,
    i have really serious problem with message pushing. The problem is that my server pushes funds updates when the user win. These funds updates may happen a lot at the same time or over 1-2 seconds, it depends on how many bets the user has done. The problem is that not all of the funds update push messages go to the client's browser(all are received in LS server and smartUpdate is called for each). So LS seems to filter them in some way even if i set mode RAW there was no change. I also tried (in MERGE&RAW):

    nonVisualTable.setRequestedMaxFrequency('unfiltere d'); nonVisualTable.setRequestedBufferSize('15');


    Please help me this is really important. Is it possible to set the above settings only for specific item not for the whole table?

    P.S. If i does matter i do not use snapshots:listener.smartUpdate(handle, map, false);
    I also tried RAW mode with the default RequestedMaxFreq and RequestedBufferSize, but still no effect.
    Regards.

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

    It seems that this was my partially my fault. When a user win a bet, i change the group (unsubscribe/remove him from the market data for specific asset, which is used to price the user's bet). If the user has many bets that have to be closed at the same time(or quickly one after another) after each close restart method is called and because of this restart LS does not send some of the messages. I removed the method call and every thing is OK. But this is a problem because if i don't unsubscribe (call restart with new group) i will continue to receive market data messages for bets that were closed.
    I must optimize this restart method because every time new NVT table is created.
    Here is the code:
    Code:
    private native JavaScriptObject getNVT(String[] group, String[] schema, String sourceType) /*-{
    	var nonVisualTable = new $wnd.NonVisualTable(group, schema, sourceType);
    	return nonVisualTable;
    }-*/;
    
    public void restart() {
    	if (isInitialized) {
    		final String[] schema = NonVisualGWTClient.this.schema.keySet().toArray(new String[0]);
    		final JavaScriptObject nvt = getNVT(NonVisualGWTClient.this.group.keySet().toArray(new String[0]), schema,
    			NonVisualGWTClient.this.sourceType);
    		this.nvt = nvt;
    		restart(nvt, this, page, config, schema);
    	}
    }
    
    private native void restart(JavaScriptObject nvt, NonVisualGWTClient thiz, JavaScriptObject page, 	JavaScriptObject map, String [] schema) /*-{
    
    	nvt.setDataAdapter(map['adapter_name']);
    	nvt.setSnapshotRequired(false);
    
    	this.@com.trinitas.ls.client.NonVisualGWTClient::nvt.onItemUpdate = function(item, itemUpdate, itemName) {
    		for (i=0;i<schema.length;i++) {
    			try {
    				var msg = itemUpdate.getNewValue(schema[i]);
    				if (msg !=null) {
    					thiz.@com.trinitas.ls.client.NonVisualGWTClient::onMessage(Ljava/lang/String;Ljava/lang/String;)(msg, schema[i]);
    				} 
    			} catch(error) {
    				alert(error);
    			}
    		}
    	}
    																					page.addTable(nvt,"tnvt");
    }-*/;
    The full source code is available in:
    Lightstreamer Lightstreamer Client Development Web Client API Other Toolkits Google Web Toolkit Integration

    Basically i need to create NVT just once and provide interface to change the group&schema, but in the NVT docs i could not find anything about changing them.

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    My editing on your last post was to fix code indentation issues.

    Dynamically changing the group associated with any kind of table is not supported and a full deletion and readd of the table is needed.
    However, you can use multiple NonVisualTable instances, one for each item, so that you can add and delete tables whenever you like.
    I suppose that in your wrapping library you could choose to hide the multiple underlying tables and still provide a single table interface.

    The same limitation holds about fields. This is even more annoying, because, in order to change a schema and keep the subscription active, you still need to remove and readd the table.
    In this case, in order to wrap the transition and make it seamless, some more work would be needed, depending on the subscription type.
    Filtered MERGE and COMMAND would be the simplest cases, because of snapshot support; unfilteres modes would be the more complex cases.

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

    thanks for the response. I managed to fix the issue with dynamic subscription. I just implemented code that onResubscribeEvent checks if LS client could be "restarted".The check is done with criteria that i pass to it, so if it needs to "restart" & criteria is evaluated to true then restart else retry again later.

    Regards.

 

 

Similar Threads

  1. Sending a message to the client
    By colmfield in forum Client SDKs
    Replies: 2
    Last Post: August 26th, 2010, 10:52 AM
  2. Sending an image to the client
    By mnanda in forum Client SDKs
    Replies: 2
    Last Post: July 16th, 2010, 12:04 PM
  3. problems with repeated messages
    By naitsir in forum Adapter SDKs
    Replies: 4
    Last Post: November 26th, 2009, 07:25 PM
  4. sending multiple snapshot (true) event in smartUpdate()
    By Pradeep Chahal in forum Adapter SDKs
    Replies: 6
    Last Post: October 12th, 2009, 01:25 PM
  5. get custom messages in web client
    By rd2008 in forum Client SDKs
    Replies: 3
    Last Post: October 30th, 2008, 11:25 AM

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 09:38 AM.