huunghia
Dear Lightstreamer experts,
I have developed an online trading application which is deployed into Jboss 4.0. The security information was developed based on JSP using Javascript client API 4.0 which received streaming data from Lightstreamer server (Colosseo 5.0). Everything worked fine with the Javascript client API 4.0 until I decided to port my Client pages from Javascript client API 4.0 to Javascript client 6.0. I followed the porting guide from Lightstreamer exactly. However, after porting the code, it seems that the new client page cannot connect to LS server in Streaming mode.
I tested with Safari and the status message shown that the connection is in Polling mode and of course, the data returned very slow. Then I switched to Firefox and sometimes, the connection can be in Streaming mode (sometimes it's not).
I tried to deploy demos application (stock list demo) to my Jboss server and the same issue occurred even this demo application is in normal streaming connection if deploying out of Jboss 4.0.
My question is: whether we need to configure something in Jboss 4.0 besides doing porting JSP code from Javascript API 4.0 to API 6.0 to have streaming mode available?
Thanks in advance for your supports.
Nghia Pham
Mone
Hi,
Can you please attach a server log snippet for each one of the three configurations?
- old lib
- new lib in jboss
- new lib without jboss
(just be sure to have the LightstreamerLogger.requests log category set to INFO)
Is there any reverse proxy between the client browser and the Lightstreamer server?
huunghia
Hi Mone,
Thanks for your reply. Sorry that we cannot deploy the application out of Jboss. We can just run LS demos without Jboss only and I believe you can have the log at your side. Please note that your LS demos faced the same issue if I deployed them on the jboss 4.0.
This is the log of the new lib with Jboss:
15-Oct-12 14:20:51,657|INFO |LightstreamerLogger.init |main |Server "Lightstreamer HTTP Server" listening to *:80 ...
15-Oct-12 14:21:03,281|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 5 |Serving request: /lightstreamer/create_session.js?LS_phase=2801&LS_cause=new.api&LS_polling=true&LS_polling_millis=0&LS_idle_millis=0&LS_client_version=6.0&LS_adapter_set=viTrade&LS_container=lsc&LS_eng=611& on "Lightstreamer HTTP Server" from 192.168.1.248:50636
15-Oct-12 14:21:03,326|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 8 |Starting new session: Sf6ad60b5cd42d1f9T2103313 on "Lightstreamer HTTP Server" from 192.168.1.248:50636
15-Oct-12 14:21:03,387|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 4 |Serving request: /lightstreamer/STREAMING_IN_PROGRESS?LS_session=Sf6ad60b5cd42d1f9T2103313&LS_phase=2804&LS_cause=ws.notgood&LS_content_length=500000&LS_container=lsc&LS_eng=611& on "Lightstreamer HTTP Server" from 192.168.1.248:50636
15-Oct-12 14:21:03,394|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 4 |Attaching session: Sf6ad60b5cd42d1f9T2103313 on "Lightstreamer HTTP Server" from 192.168.1.248:50636
15-Oct-12 14:21:03,499|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 3 |Serving request: /lightstreamer/control.js?LS_table=1&LS_win_phase=44&LS_req_phase=660&LS_op=add&LS_mode=MERGE&LS_id=stockcode_ABT%5Elang_vn%5Epart_upper%5Erandom_675&LS_schema=StockNameupper%20LastPriceupper%20Changeupper%20ChangeRatioupper%20Openupper%20Highupper%20Lowupper%20Refupper%20Avgupper%20Ceilupper%20Flrupper%20BV4upper%20OV4upper%20Volupper%20Valueupper%20FBupper%20FSupper%20FRoomupper%20TRoomupper%20Exchupper%20Flagupper%20LastBidupper%20LastOfferupper%20BVol1upper%20Bid1upper%20OVol1upper%20Offer1upper%20BVol2upper%20Bid2upper%20OVol2upper%20Offer2upper%20BVol3upper%20Bid3upper%20OVol3upper%20Offer3upper%20TBidVolupper%20TBidAmtupper%20TOfferVolupper%20TOfferAmtupper%20lblLastupper%20TBidPercentupper%20TOffPercentupper%20MktStsupper%20Sum1wChgupper%20Sum1mChgupper%20Sum3mChgupper%20SumYhgupper%20SumYlwupper%20SumFluctupper%20SumEpsupper%20SumPerupper%20SumDpsupper%20SumYeildupper%20SumIssuedupper%20SumMktCapupper&LS_data_adapter=SingleStock&LS_snapshot=true&LS_unique=1&LS_session=Sf6ad60b5cd42d1f9T2103313& on "Lightstreamer HTTP Server" from 192.168.1.248:50641
15-Oct-12 14:21:03,512|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 1 |Controlling session: Sf6ad60b5cd42d1f9T2103313 on "Lightstreamer HTTP Server" from 192.168.1.248:50641
15-Oct-12 14:21:04,200|WARN |LightstreamerLogger.preprocessor |eStock simple updates queue|Unexpected snapshot event for MERGE item stockcode_ABT^lang_vn^part_upper^random_675
And there is 1 error on the log:
15-Oct-12 14:21:07,542|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 5 |Serving request: /lightstreamer/control.js?LS_op=force_rebind&LS_cause=timeout.5.2&LS_unique=2&LS_session=Sf6ad60b5cd42d1f9T2103313& on "Lightstreamer HTTP Server" from 192.168.1.248:50641
15-Oct-12 14:21:07,542|WARN |LightstreamerLogger.preprocessor |eStock simple updates queue|Unexpected snapshot event for MERGE item stockcode_ABT^lang_vn^part_upper^random_675
15-Oct-12 14:21:07,543|WARN |LightstreamerLogger.preprocessor |eStock simple updates queue|Unexpected snapshot event for MERGE item stockcode_ABT^lang_vn^part_upper^random_675
15-Oct-12 14:21:07,543|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 5 |Forcing rebind on session: Sf6ad60b5cd42d1f9T2103313 on "Lightstreamer HTTP Server" from 192.168.1.248:50641
And this is the log from the old lib (4.0). We can get streaming data with the old lib.
Connection: keep-alive
Host: ls.testing.com
LS_session=Sc5b389e1513656beT0228955&LS_table=1&LS_win_phase=20&LS_req_phase=873&LS_op=add&LS_mode=MERGE&LS_id=stockcode_ABT%5Elang_vn%5Epart_upper%5Erandom_43&LS_schema=StockNameupper%20LastPriceupper%20Changeupper%20ChangeRatioupper%20Openupper%20Highupper%20Lowupper%20Refupper%20Avgupper%20Ceilupper%20Flrupper%20BV4upper%20OV4upper%20Volupper%20Valueupper%20FBupper%20FSupper%20FRoomupper%20TRoomupper%20Exchupper%20Flagupper%20LastBidupper%20LastOfferupper%20BVol1upper%20Bid1upper%20OVol1upper%20Offer1upper%20BVol2upper%20Bid2upper%20OVol2upper%20Offer2upper%20BVol3upper%20Bid3upper%20OVol3upper%20Offer3upper%20TBidVolupper%20TBidAmtupper%20TOfferVolupper%20TOfferAmtupper%20lblLastupper%20TBidPercentupper%20TOffPercentupper%20MktStsupper%20Sum1wChgupper%20Sum1mChgupper%20Sum3mChgupper%20SumYhgupper%20SumYlwupper%20SumFluctupper%20SumEpsupper%20SumPerupper%20SumDpsupper%20SumYeildupper%20SumIssuedupper%20SumMktCapupper&LS_data_adapter=SingleStock&LS_snapshot=true&LS_unique=1& from 192.168.1.248:49682
15-Oct-12 14:02:29,289|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 10 |Serving request: /lightstreamer/control.js --> LS_session=Sc5b389e1513656beT0228955&LS_table=1&LS_win_phase=20&LS_req_phase=873&LS_op=add&LS_mode=MERGE&LS_id=stockcode_ABT%5Elang_vn%5Epart_upper%5Erandom_43&LS_schema=StockNameupper%20LastPriceupper%20Changeupper%20ChangeRatioupper%20Openupper%20Highupper%20Lowupper%20Refupper%20Avgupper%20Ceilupper%20Flrupper%20BV4upper%20OV4upper%20Volupper%20Valueupper%20FBupper%20FSupper%20FRoomupper%20TRoomupper%20Exchupper%20Flagupper%20LastBidupper%20LastOfferupper%20BVol1upper%20Bid1upper%20OVol1upper%20Offer1upper%20BVol2upper%20Bid2upper%20OVol2upper%20Offer2upper%20BVol3upper%20Bid3upper%20OVol3upper%20Offer3upper%20TBidVolupper%20TBidAmtupper%20TOfferVolupper%20TOfferAmtupper%20lblLastupper%20TBidPercentupper%20TOffPercentupper%20MktStsupper%20Sum1wChgupper%20Sum1mChgupper%20Sum3mChgupper%20SumYhgupper%20SumYlwupper%20SumFluctupper%20SumEpsupper%20SumPerupper%20SumDpsupper%20SumYeildupper%20SumIssuedupper%20SumMktCapupper&LS_data_adapter=SingleStock&LS_snapshot=true&LS_unique=1& from 192.168.1.248:49682
15-Oct-12 14:02:29,303|INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 11 |Controlling session: Sc5b389e1513656beT0228955 from 192.168.1.248:49682
15-Oct-12 14:02:29,310|DEBUG|htstreamerLogger.connections.http|SERVER POOLED THREAD 11 |Writing response:
HTTP/1.1 200 OK
Server: Lightstreamer/4.0.1 build 1513.1.3 (Lightstreamer Push Server - www.lightstreamer.com) Moderato edition
Dario Crivelli
The log reports a couple of WARN messages, but they are not errors and should not cause problems.
What happens is that your Data Adapter issues "update" or "smartUpdate" calls for some item, setting the "snapshot" flag also when the update is not the first one for the item.
This should be unrelated with your current problems.
In order to better compare the cases, please send us longer log snippets, starting before you ask for the page and covering at least 10 seconds.
By the way, your last log line reports "Lightstreamer/4.0.1 build 1513.1.3", whereas you said you were using the Colosseo (5.0) Server in both cases and that the only difference was the version of the JavaScript client library; may you please clarify?
Note that the JavaScript client library 4.0 is really old; can you confirm you are using this version, by looking at the included build.number file?
huunghia
Hi Dario Crivelli,
First of all, sorry for giving some wrong information. The client version I used before is version 5.0, not 4.0 as mentioned. And yes, the log I posted before is also with wrong server package (ie. 4.0).
Back to the issue, I attached the 3 logs: 1 with client version 5.0 on Jboss, 1 with client version 6.0 on jboss and the final one is the log when I run demo apps without jboss (3 of them are with server 5.0).
Checking the log of client version 5.0, I found that it seems that there is still "LS_polling=true". However, because the data is returned fast, that's why I had the feeling that it's in streaming mode. Comparing to the client version 6.0 on jboss, the retry in streaming-sense mechanism caused the latency in data return.
Hence, my question is now:
- Why deploying in jboss, there is no streaming (even I deployed the demo app client in jboss)?
Thanks in advance for your reply.
Nghia Pham
Dario Crivelli
Nghia Pham, sorry for adding a roundtrip, but for a full comparison of the cases we would also like to see a log of the StockListDemo with client library 6 deployed on JBoss, where you say it encounters the same issues as your application.
For now, the main difference between the two scenarios with your application (that is, with library 5.0 or 6.0) is that in the 5.0 case a common subdomain is set (namely testing.com), whereas in the 6.0 case it is not.
In fact, since 6.0, access from client pages to Lightstreamer Server no longer requires that a common subdomain is declared, provided that a proper configuration of cross site access has been provided.
Although the cross site access configuration must be correct (otherwise you wouldn't see the updates at all), it may impact on the streaming behavior in a few cases.
Does your client page issue "setCookieHandlingRequired(true)"?
Even if not, please try adding a common subdomain declaration to your client page, to see if anything changes. Note that with client library 6.0 there isn't a "setDomain" method anymore; you should just issue document.domain='testing.com'; early in your page. Obviously, the hostnames should be used consistently in the test.
By the way, what browser have you used for these testcases?
As a side note, I see that your logs are overwhelmed by the "Unexpected snapshot event for MERGE item ..." messages.
Although, as I said, this is not an issue, please check your calls to "update" or "smartUpdate" and ensure that the snapshot flag is set to false on any invocation that is used to forward real time updates; if in doubt, try setting it to false always.
huunghia
Thanks for your guide, Dario. We have just resumed the project as another project is with high priority.
Attachment is the log of StockListDemo with client library 6 deployed on Jboss and you can see that the it ran in polling mode. We tested on Safari.
We will try to follow your guide and feedback to you soon.
Dario Crivelli
The log seems incomplete; can you confirm that all you see in the log is what you sent us?
In this case, may you please retry the test and collect the log after setting the LightstreamerLogger.requests.polling logger at INFO level?
Until then, we cannot infer, from this log, that the session shown was in polling;
the LS_polling=true text that you see in the log has only a temporary scope and it is also used in streaming sessions.
May you please specify the version of Safari in use?
We wait for more feedback. In particular, please try the test by adding the domain setting in your app for javascript library version 5, as explained in my previous post.
QuyenNguyen
Dear Dario
On behalf of Nghia, I would like to continue the thread. We already added domain setting and tried again on Fire Fox and Safari (version 3.2.2). Please refer to attached logs of the 2 cases.
In Safari case, we notice that the session is not established at the first call, and have to force rebind several times.
Serving request: /lightstreamer/STREAMING_IN_PROGRESS?LS_session=S3fe4dab291897687T0935312&LS_phase=8804&LS_cause=ws.notgood&LS_content_length=500000&LS_container=lsc&LS_eng=468& on "Lightstreamer HTTP Server" from 192.168.1.93:10485
Hope this log can help you to figure out the problem.
Thanks
Quyen
Mone
Hi,
I'm still not sure about what's happening on the client. Anyway can you please try to set a wider domain on the page that creates the LightstreamerClient instance?
e.g.: if you page is
http://www.mysite.com/testpage.htmladd the following line
before creating the LightstreamerClient instance:
[SYNTAX=JS]document.domain="mysite.com";[/SYNTAX]
If this does not solve the issue, please send us a new log showing a connection made with the client code modified with the above line.
QuyenNguyen
Hi Mone,
I already tried to add
document.domain='testing.com'; in the previous try. Below is the code in client:
document.domain='testing.com';
var hostToUse = "http://testing.com:81";
define("lsClient",["LightstreamerClient","StatusWidget"],function(LightstreamerClient,StatusWidget) {
var lsClient = new LightstreamerClient(hostToUse,"DEMO");
lsClient.connectionSharing.enableSharing("DemoCommonConnection", "ATTACH", "CREATE");
lsClient.addListener(new StatusWidget("left", "0px", true));
lsClient.connect();
return lsClient;
});
Please find the latest log and screen capture attached.
Thanks.
Mone
Sorry, my bad,
I forgot to specify: you should set the domain to "testing.com" as you did, but you should use a longer host name like
"http://push.testing.com:81";
HTH
QuyenNguyen
We tried to use LS.testing.com:81 for the LS connect host (which is map to the same IP), and result still the same.
Mone
was the host used to access the page something like
http://www.testing.com ?
If you check the server log is there a LS_domain parameter in the create_session / STREAMING_IN_PROGRESS / bind_request request(s) issued by the client library?
Any possibility you can have both the web server and lightstreamer server on port 80?
Any chance for you to let me access your application via internet?