View Full Version : Integrating with a J2EE Application Server
mvelik
11-20-2006, 10:39 PM
Hello,
I am evaluating your product and it does look very attractive. Here is a question though. Currently we have a J2EE-compliant application deployed on a BEA Weblogic App server. What would be the best way to integrate it with the LightStreamer Server?
Thanks,
Mike
Alessandro
11-21-2006, 12:55 PM
Hello Mike,
Thank you for the compliments.
From a system-architecture point of view, Lightstreamer Server sits along with any Web Server in the DMZ:
http://www.lightstreamer.com/img/grafico.jpg
The Web Server will serve all the pages and resources of the Web application (html, JS, css, images, etc.). The Web application can be based on any framework, toolkit or paradigm, with no constraints. For example, the Web Server could leverage a J2EE Application Server (usually beyond the second firewall) to have the HTML generated through JSP, servlets, Struts and JSF. Such HTML will include the Lightstreamer JavaScript libraries to make the pages live on the client side. This means that the integration of Lightstreamer JS libs is independent on the kind of server-side framework used to generate the pages.
The role of Lightstreamer Server is to deliver the real-time updates to the browser (though the provided JS libraries).
Lightstreamer Server needs to connect to both a data feed (to get the real-time data) and to some authentication(authorization system (to handle permissionig, entitlement, etc.). This is accomplished through custom Data and Metadata Adapters that are plugged into Lightstreamer Server. So, if the data feed and authorization logic resides in the J2EE App Server, then the Lightstreamer Adapter will be developed in order to access the App Server. This is a custom development done by the system integrator so any kind of middleware or protocol can be used to connect LS Server with the App Server. Often JMS is employed for the Data Adapter. EJB, Web Services, DB queries are frequent options for the Metadata Adapter.
CitiMan
11-21-2006, 07:15 PM
Following on this same subject, I would like a search form that once served by the application server, posts it's form data to a Lightstreamer DataAdapter. I am not sure at present how to communicate this form data (even as query string) to the lightstreamer server, nor do I know how to access a query string from the data adapter.
Is this possible?
thanks
Alessandro
11-21-2006, 08:49 PM
Do you mean anything similar to the RoundTrip Demo (http://www.lightstreamer.com/roundTripDemo.htm) or anything else?
In the RoundTrip Demo (http://www.lightstreamer.com/roundTripDemo.htm) the data written in the form is sent to a servlet, that publishes it on a JMS bus (provided by JBoss App Server). The LS Data Adapter implements a JMS subscriber that receives the data and injects it into Lightstreamer Kernel, that in turns delivers it to the Clients that have subscribed to that item.
So the flow is:
browser form --> servlet --> JMS --> LS Data Adapter / LS Kernel --> browsers
This is a flesible approach, because in a clustered environment more instances of Lightstreamer Server can receive the client contribution through JMS.
For simpler scenarios, Lightstreamer offers the sendMessage() (http://www.lightstreamer.com/docs/client_web_jsdoc/LightstreamerEngine.html#sendMessage) method to directly deliver any data to the Metadata Adapter (that can pass it to the Data Adapter).
CitiMan
12-01-2006, 12:31 PM
regarding the sendMessage() js function, can you post some sample server side code that shows how this message is intercepted and passed to the DataAdapter?
thanks
Hi,
Sorry, but actually I don't have any piece of code using the sendMessage.
You have to implement MetadataProvider (http://www.lightstreamer.com/docs/adapter_java_javadoc/com/lightstreamer/interfaces/metadata/MetadataProvider.html)'s notifyUserMessage (http://www.lightstreamer.com/docs/adapter_java_javadoc/com/lightstreamer/interfaces/metadata/MetadataProvider.html#notifyUserMessage%28java.lang.String,%20java.lang.String,%20java.lang.String%2 9) to intercept user's messages.
To pass the message received from the MetaDataApadter to the DataAdapter there isn't a fixed way.
You can for (very simple) example save the refrence of your DataAdapter instance in a static variable and then access that static variable from the MetaDataAdapter to pass the message.
Hope that helps.
Mone.
I've moved the discussion about the comunication between Adapters here:
http://www.lightstreamer.com/vb/showthread.php?p=125
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.