rajesh.palanisamy
Hi,
I am using COMMAND MODE, during retrieval of snapShot data in subscribe method, if i receive the hot updates and started to smartPush,
1. will the Lskernal hold the publish to the clients until my snapShot retrieval is completed. ( I issue a endOfSnapshot call when my snapShot retrieval is completed )
2. If Lskernal wont hold , i may loose the delivery order say stale data might be pushed to the clients. How can I ensure the snapShot is published first followed by my hot update events or a merged value is pushed to all clients
Ex: Snapshot retrieval of ITEM_1 has stock price of 1.23 and hot update gives me a price of 1.50. The client must either receive as below, 1. Add event (1.23) followed by UPDATE event (1.50)
or
2. Kernal merges the value and send only 1.50 to the clients
The above example is considered when there is a delay in snapshot retrieval and meanwhile hot updates are received in the adapter.
How should i ensure in-order delivery if LightStreamer doesn't handle it. Or will it handle the delivery order.
Thanks
Rajesh
Dario Crivelli
Hi Rajesh,
The mechanism you need is not provided by Lightstreamer kernel and it is requested to the Data Adapter.
The Server receives a single event flow from the Adapter.
This means that the Adapter should take care of sending all the currently active keys (i.e. the snapshot) before sending the EndOfSnapshot signal and, subsequently, the real-time updates.
So, some synchronization is needed and the best case is when the back-end is able to do that.
Otherwise, if you have to ask for snapshot and real-time updates separately, your only option is to hold any real-time updates within the Data Adapter until the snapshot has arrived.
However, by doing this, the Data Adapter should also ensure that real-time updates are really later than the snapshot.
For instance, you should ask the back-end to provide a timestamp for both the snapshot and the real-time update values.
In this way, after forwarding the snaphot to Lightstreamer, you should send only the accumulated real-time updates with a later timestamp.