PDA

View Full Version : Multiple Data Provides


wwatts
03-17-2009, 01:03 AM
In the trial version of Lighstreamer, is it possible to use adapter sets for .NET? I need to have multiple data providers under a single adapter. Could you please provide an example XML file showing this configuration. By the way, I am using the adapter.xml file provided in the HelloWorld example as a starting point.

Thanks in advance.

Mone
03-18-2009, 10:16 AM
hi,

you can use multiple .net data adapters within a single adapter set. You just have to configure the adapters.xml correctly so that it can connect to your remote .net adapters.

e.g.:
<?xml version="1.0"?>

<adapters_conf id="PROXY_HELLOWORLD">

<metadata_provider>
<adapter_class>com.lightstreamer.adapters.metadata.LiteralBasedProvider</adapter_class>
</metadata_provider>

<data_provider name="adapter1">
<adapter_class>com.lightstreamer.adapters.remote.data.NetworkedDataProvider</adapter_class>
<param name="request_reply_port">6661</param>
<param name="notify_port">6662</param>
</data_provider>

<data_provider name="adapter2">
<adapter_class>com.lightstreamer.adapters.remote.data.NetworkedDataProvider</adapter_class>
<param name="request_reply_port">6663</param>
<param name="notify_port">6664</param>
</data_provider>

</adapters_conf>
note the name property of the <data_provider> element

obviously you have to configure your second data adapter to use port 6663 and 6664 instead of using 6661 and 6662.

From a client point of view you must now set the adapter name to receive data from the desired data adapter:
var page = new PushPage();
page.onEngineCreation = function(engine) {
engine.connection.setAdapterName("HELLOWORLD");
engine.changeStatus("STREAMING");
}
page.bind();
page.createEngine("HelloWorldApp", "LS", "SHARE_SESSION");

var pushtable = new OverwriteTable(null, null, "MERGE");
pushTable.setDataAdapter("adapter1");
page.addTable(pushtable, "hellotable");
note the setDataAdapter (http://www.lightstreamer.com/docs/client_web_jsdoc/Table.html#setDataAdapter) call

hope that helps