[deepamehta-devel] WebSockets

Juergen Neumann j.neumann at junes.eu
Mi Jan 8 10:52:05 CET 2014


Hi Jörg,

I had talked to Danny about websocket implementation a few days a go. He
said that Jetty would not fit into apache OSGi framework anyways and
that for the karaf version he would need to use PAX anyways. 

I would therefor hardly recommend to shift away from Jetty towards PAX
even though its footprint might be slightly bigger.

Did you and Danny disscuss this issue in person? If not, I would hardly
recommend that you speak to each other and clearify the future strategy
here.

Greets,

JuergeN

Am Dienstag, den 07.01.2014, 04:40 +0100 schrieb Jörg Richter:
> Hi,
> 
> I like to announce my first WebSockets experiences with DM.
> As a technology demo I created a new plugin (for usage info see the README):
> https://github.com/jri/dm4-websockets
> 
> What this plugin does:
> - Setup a WebSocket server at ws://localhost:8081/ and wait for WebSocket clients
> - Listen for Topic Update events from the DM Core and push them to all connected WebSocket clients (broadcast)
> - Write all WebSocket messages (handshake, open, message, frame, control, close) to the DM server log
> - Provide a WebSocket client at http://localhost:8080/de.deepamehta.websockets/
> 
> What the WebSocket client does:
> - Establish a WebSocket connection to ws://localhost:8081/
> - Send a greeting message to the server once the connection is established
> - Log all received messages (Topic Update events) to the browser console
> - Log the connection open and close events to the browser console
> 
> So, the dm4-websockets plugin demonstrates all technical aspects of WebSockets. It performs no useful task, and it is not yet extensible by 3rd party plugin developers. It's just a tech demo.
> 
> How the dm4-websockets plugin is realized:
> - Bundle a Jetty 7 web server and the jetty-websocket extension
> - Instantiate a Jetty Server on port 8081 and set a WebSocketHandler
> 
> That means when the dm4-websockets plugin is installed the Jetty binaries are bundled *twice* and 2 Jetty servers are instantiated (each on its own port).
> 
> What I've learned so far:
> - DM *can* provide WebSockets without relying on OPS4J Pax Web (an OSGi HTTP Service implementation).
> - DM can *not* use the Jetty web server that is bundled with Apache Felix HTTP Jetty (the OSGi HTTP Service implementation used by DM) because ...
> 	- The OSGi 4.2 HTTP Service specification does not allow for accessing the WebSockets capabilities of the underlying web server. So we must setup a WebSocket server on our own. And for doing that we can *not* use the bundled Jetty because ...
> 	- The org.eclipse.jetty.* Java packages of the Apache Felix HTTP Jetty bundle are not exported.
> 
> That means the dm4-websockets plugin must bundle and instantiate its own WebSocket server anyway. (This must not necessarily be a full-blown web server like Jetty.)
> 
> Please correct my if I'm wrong. I wish there would be a way to not bundle the Jetty binaries twice, and to not instantiate 2 Jetty servers, and to not open 2 HTTP ports.
> 
> Next possible step from my side:
> - Make the dm4-websockets plugin extensible by 3rd party plugin developers. That is abstracting the WebSocket server (and the Jetty API) away and provide the plugin developer a framework for handling client-side and server-side WebSocket messages.
> 
> Don't hesitate to sketch out your cool DM server push application here.
> This would be a good help for me when designing the framework.
> 
> Cheers,
> Jörg
> 
> _______________________________________________
> deepamehta-devel mailing list
> deepamehta-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/deepamehta-devel
> 





Mehr Informationen über die Mailingliste devel