• Client API
  • Command Mode - ADD items in particular order to client

Hi,

I am noticing that in single Level Command Mode adapter publish , the Add items are not received in same order as published to ItemEventListener.

Am i missing something here,

say my data Adapter does data retrieval and pushes data in order as shown
1.
ItemEventListener.smartUpdate(objectHandle, ITEM-A-VALUE-MAP ,true);
2. ItemEventListener.smartUpdate(objectHandle, ITEM-B-VALUE-MAP ,true);
3. ItemEventListener.smartUpdate(objectHandle, ITEM-C-VALUE-MAP ,true);

When Client subscribes the ItemUpdates are received in some random order, is there a way to ensure the items are received back in same published order.

Thanks
Rajesh
Hi Rajesh,

You could leverage this configuration, in lightstreamer_conf.xml:

<!-- Optional. Configuration of the update management for items subscribed to
in COMMAND mode with unfiltered dispatching, with regard to updates
pertaining to different keys.
Can be one of the following:
- Y: the order in which updates are received from the Data Adapter is
preserved when sending updates to the clients; in this case, any
frequency limits imposed by license limitations are applied
to the whole item and may result in a very slow update flow;
this was the default behavior before Server 4.0 version.
- N: provided that no updates are lost, the Server can send enqueued
updates in whichever order; it must only ensure that, for updates
pertaining to the same key, the order in which updates are received
from the Data Adapter is preserved; in this case, any frequency
limits imposed by license limitations are applied for each
key independently.
No item-level choice is possible. However, setting this flag as Y
allows for backward compatibility to versions before 4.0, if needed.
Default: N. -->
<preserve_unfiltered_command_ordering>Y</preserve_unfiltered_command_ordering>


But please let me stress out some warnings:
  • - the COMMAND mode Items have to be subscribed with the unfilterd dispatching setting (https://lightstreamer.com/docs/client_javascript_uni_api/Subscription.html#setRequestedMaxFrequency);
  • - this is a global setting, that means the apply to all the COMMAND mode Items handled by the server;
  • - in the case of global frequency limit, for example those imposed by some license types, apply for the whole Item and no longer for the individual keys. This could lead to a noticeable deterioration in performance.

Regards,
Giuseppe