View Full Version : Data Adapter's subscribe() method not getting called
CitiMan
11-29-2006, 07:36 PM
Hi again
Using the Porfolio data adapter code as a template, I am trying to create my own feed with sorting, paging etc. But I cannot get a cut down version of the Portfolio Adapter (took out the JMS-related stuff, kept the hard coded sample values) to run. For some reason on startup the subscribe method does not get called, hence no stocks are added to the table on the client, and updates continue to be created without the updateProcessor consuming any messages (it sleeps as it fails the first queue check in run method).
Do you know of any reason why the subscribe method would not be called?
DarioCrivelli
11-30-2006, 10:57 AM
Hi,
if you observed that the subscribe method is not called, then the current problem is not on the Data Adapter side.
You can collect more details on Server operation by setting as DEBUG the priority of the "LightstreamerLogger.requests" and "LightstreamerLogger.subscriptions" loggers on the Server logging configuration file.
Then, feel free to send us the log for a check.
Dario
CitiMan
11-30-2006, 01:03 PM
Thanks for the pointer, no requests coming through apparently, so it must be a javascript problem. But I am using exact same settings as was in the source (\Clients\PortfolioDemo_online) - obviously changing the port/hostname/domain values. One thing the source did not provide was the 'base' js/html files but I just used the ones that came with the server distribution (\DOCS-SDKs\sdk_client_web\lib).
Not sure what else I need to add? There is no javascript popup msgs, and although the browser status bar reads 'Lightstreamer is connecting...' nothing is displayed in the table rows
At the moment I have index.html, lsengine_config.js in root web folder with the ls html/js files in /ls/lsblank.html etc (6 files unchanged).
Hi,
Does the message remains 'Lightstreamer is connecting...' and never switches to "Lightstreamer is in streaming mode..." or "Lightstreamer is in smart polling mode..."?
If so this means that the web client is not yet connected to the Server, please re-check port/hostname/domain values and return back to me.
PS:
There is no javascript popup msgs
In our Portfolio code those messages could be disabled.
check these calls:
lsPage.context.setDebugAlertsOnClientError(false);
ls.context.setDebugAlertsOnClientError(false);
on index.html and lsengine_config.js
Turn false to true to enable messages.
Bye.
CitiMan
11-30-2006, 04:13 PM
both calls to setDebugAlertsOnClientError() are set to true.
At the moment yes all that happens is the 'Lightstreamer is connecting...' msg. Nothing further.
I've double checked the port/hostname/domain settings, all fine. I can get the simple OverwriteTable demo working with the StockList adapter so whatever it is it's specific to the client config for the Portfolio DynaMetapushTable?
Hi,
If host/domain/port is all ok maybe the problem is on the Adapters name.
The name is set client-side in the lsengine_config.js:
ls.connection.setAdapterName("PORTFOLIO");
And server side in the portfolio adapter's folder in the adapters.xml file:
<adapters_conf id="PORTFOLIO">
Can you confirm that those names match?
Note that adding a new adpater to a Lightstreamer instance requires that the Server is restarted.
CitiMan
11-30-2006, 05:01 PM
Adapter name is fine too, set to PORTFOLIO on both lsengine_config.js & in adapters.xml, located in root of /adapters/Portfolio folder on server. rest of the adapters.xml file is:
<?xml version="1.0"?>
<adapters_conf id="PORTFOLIO">
<metadata_provider>
<adapter_class>com.lightstreamer.adapters.metadata.LiteralBasedProvider</adapter_class>
<param name="search_dir">.</param>
<param name="max_bandwidth">16</param>
<param name="max_frequency">5</param>
<param name="buffer_size">30</param>
</metadata_provider>
<data_provider>
<adapter_class>com.lightstreamer.adapters.portfolio.PortfolioDemoProvider</adapter_class>
<param name="config_file">portfolio.conf.properties</param>
</data_provider>
</adapters_conf>
CitiMan
11-30-2006, 05:11 PM
I should maybe also point out the only difference I have in architecture is that the index.html and other js/html files are located on a tomcat server (8080) with the lightstreamer server (8081) on the same host/domain.
CitiMan
11-30-2006, 05:26 PM
changed loadEngine to loadEngineMinimal and added the startEngine js function to lsPage's onEngineReady event and works fine now :)
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.