juicebox225
Hi all,
I'm using JavaScript / HTML as the client, with a Java Lightstreamer adapter serving the data.
The problem I am encountering is that whenever I attempt to subscribe to an item, and specify a field on that item that doesn't exist, subsequent subscriptions all seem to fail silently. How do I know they're failing? Because my subscription listener returns null for every fieldValue that is returned. It does this once, after the subscription is made, and then never again does that listener receive data updates despite the item changing!
I am wondering a basic question:
Does attempting to create a Subscription with invalid fields, break lightstreamer? By invalid fields, I mean fields that do not exist on the item.
Any help would be great!
juicebox225
BUMP with more information:
From the lightstreamer logs, I see the following when the data adapter updates the item:
10-Jan-15 13:35:55,836|DEBUG|LightstreamerLogger.subscriptions|Thread-25 |Ignored late update for item item1
What the hell is a 'late update'? I see no documentation about this.
juicebox225
Please help!
Why can I not unsubscribe from an item, reset the fields of the subscription, and then re-subscribe? All I get after re-subscribing is
"Ignored late update for item item1"
The abstracted workflow looks like this:
lightstreamerClient.subscribe( item1Subscription );
... do some stuff on the page ...
lightstreamerClient.unsubscribe( item1Subscription );
... do some more stuff on the page ...
item1Subscription.setFields( newFields );
lightstreamerClient.subscribe( item1Subscription );
juicebox225
Figured the issue out.
When a client unsubscribes, and then re-subscribes, you should be updating the _itemHandle in the Java adapter to use the new _itemHandle.
Dario Crivelli
Correct.
About fields, the fields specified in a subscription are free from constraints.
A subscribed field that is never included in any update event for the item by the Data Adapter will just carry a null value in the snapshot and will be reported as unchanged in all updates.