Alessandro Alinone
Starting from ARI v.1.2 build 34 (which ships with Lightstreamer Server v.3.5) a new Proxy Data Adapter has been released, which includes auto-recovery capabilities. In other words, the life cycle of Lightstreamer Server is no more necessarily bound to the life cycle of the Remote Data Adapters.
The new Proxy Data Adapter class is named RobustNetworkedDataProvider.
Below is the template for the <data_provider> section of the adapters.xml configuration file, which includes inline documentation of the new recovery features.
[SYNTAX="XML"] <data_provider>
<!-- Mandatory. The RobustNetworkedDataProvider communicates with its remote counterpart
through standard TCP sockets. It listens on two specific ports and waits for
its counterpart to connect.
Moreover, this Data Adapter manages the case in which the remote
counterpart is missing, by accepting subscriptions and sending empty
snapshots to the clients, when requested (note that the clients
should be able to manage null field values for items subscribed to
in MERGE mode).
This Data Adapter also manages failures of the remote counterpart,
by waiting for connection from a new remote adapter and trying
to recover the data flow. -->
<adapter_class>com.lightstreamer.adapters.remote.data.RobustNetworkedDataProvider</adapter_class>
<!-- Mandatory for RobustNetworkedDataProvider. The request/reply port to listen on. -->
<param name="request_reply_port">6661</param>
<!-- Mandatory for RobustNetworkedDataProvider. The notification port to listen on. -->
<param name="notify_port">6662</param>
<!-- Optional, specific for RobustNetworkedDataProvider.
The timeout for reconnection attempts. After an unsuccessful attempt
by a remote server to connect to this Proxy Adapter, the Adapter can
retry accepting more connection attempts after waiting for this time.
A negative value prevents further attempts, so that no remote server
will be available.
Default: -1. -->
<param name="connection_recovery_timeout_millis">10000</param>
<!-- Optional, specific for RobustNetworkedDataProvider.
The strategy to be adopted whenever a new remote server is available
in order to restore the data flow for items that were subscribed to
while no remote server was available.
No sophisticated recovery algorithms are available, as they could
only depend on the specific item meanings.
Currently, the only available options are:
- leave_hole
The real time update flow is just restarted; this may give rise
to an inconsistent overall flow:
for RAW and DISTINCT subscriptions, there will be a hole in the
event sequence;
for MERGE and COMMAND subscriptions, out of date field values
might be mixed with up to date field values on the same item or key;
for COMMAND subscriptions, some keys might be missing for some
time and others might remain garbage for long time; some harmless
warning messages might also be issued by the Server.
- use_snapshot
The snapshot of the item is requested to the remote server and
it is sent in the update flow "as is"; this strategy is suitable
for MERGE subscriptions, while in other cases it may give rise
to an inconsistent overall flow:
for RAW subscriptions, there will be a hole in the event sequence
and possible spurious entries;
for DISTINCT subscriptions, there migth be either a hole or some
duplicates in the event sequence;
for COMMAND subscriptions, some keys might just remain garbage
for long time; some harmless warning messages might also be
issued by the Server.
The configured strategy will be applied with all items.
Default: leave_hole. -->
<param name="events_recovery">use_snapshot</param>
<!-- Optional. The local network interface to bind to.
If not specified, it will bind to any available interface. -->
<!--
<param name="interface">192.168.1.1</param>
-->
<!-- Optional. Name of the Proxy Data Adapter, to better identify its threads when
assessing problems. If not specified, it will be assigned a progressive number. -->
<!--
<param name="name">MyFeedData</param>
-->
<!-- Optional. Timeout for synchronous requests. Default is 10000 ms (10 seconds). -->
<!--
<param name="timeout">10000</param>
-->
</data_provider>[/SYNTAX]