© www.role-project.eu
Interwidget Communication with XMPP
Dominik Renzel ([email protected]) Chair of Computer Science 5 – Databases & Information Systems
RWTH Aachen University, Germany
FOSDEM 2012 – XMPP DevRoom Feb 4, 2012, Brussels, Belgium
Widget Mashups as Personal Learning Environments (PLE)
Remote Communication & Collaboration in Widget-based PLE
ROLE Widget Container UI
See demo video on youtube
ROLE Setup
ROLE Widget Container Technologies
ROLE Widget Container Apache Shindig/Rave/Wookie
OpenSocial Gadgets (& W3C Widgets) Widget container & rendering
ROLE RESTful Services ROLE Interwidget Communication Framework
Local: HTML5 Web Messaging Remote: XMPP Publish-Subscribe
ejabberd + nginx + strophe.js + strophejs-plugins Core RFCs (6120,6121,6122) XMPP over BOSH (XEP-206) Multiuser Chat (XEP-45) Publish-Subscribe (XEP-60) Some extensions of strophejs-plugins recently upstream More to follow
ROLE Interwidget Communication Architecture
ROLE Interwidget Communication Client API
Function Description connect(callback) Connects the client to local interwidget communication.
After successful call, the client is able to publish and receive intents. Received intents are passed to the callback function.
disconnect() Disconnects the client from interwidget communication. publish(intent) Publishes a JSON-encoded intent.
ROLE IWC Client Initialization var client = new iwc.Client(); client.connect(function(intent){ // process intent });
ROLE IWC Intent Payload Format
Google Android-like Intents Developers decide local/remote publish Special flags: PUBLISH_GLOBAL, PUBLISH_LOCAL
var intent = { "component": "", "sender":"[email protected]?http://widget.org/sender.xml", "data":"http://data.org/some/data", "dataType":"text/xml", "action":"ACTION_UPDATE", "categories":["category1","category2"], "flags" :["PUBLISH_GLOBAL"], "extras":{"key1":val1, "key2":val2} };
Publishing ROLE IWC Intents
function sendIntent(intent) { if (iwc.util.validateIntent(intent)){ client.publish(intent); } }
Create Intent Validate Intent Publish Intent
ROLE Interwidget Communication Architecture
Major requirement: User must stay aware and in control of incoming/ outgoing intents
Trust-based approach User me sets trust value t(me,u) for other user u User me sets trust threshold T(me) Intents from u dropped by me, if t(me,u)<T(me) Trust inference for unknown peers based on trust network
(XMPP over) BOSH vs. WebSocket
Property BOSH WebSocket Connections Two concurrent One Connection Persistence Repeated open/close Persistent Transportable Data Textual only Textual, binary Latency High Low Package Overhead High (180+ bytes for
headers per roundtrip) Low (2 bytes for frame headers)
Uptake High Low XMPP Servers Most Few XMPP JS Libraries All Only some experimental Browser support Most Few
XMPP over WebSocket to obsolete BOSH with stable specifications and implementations
WebSocket XMPP Gateway (WXG)
Based on "An XMPP Sub-protocol for WebSocket" (J. Moffit, E. Cestari) Experimental implementation based on Jetty Source: https://github.com/hocken/wxg Additional experimental JS lib for XMPP over WebSocket JS Lib (-> strophe.js?) Unfortunately broken with appearance of new WebSocket RFC
XMPP at Our Chair
Inter/National Project Work (ROLE, UMIC, etc.) XMPP Working Group Teaching: Web Science Lecture feat. XMPP Basics Bachelor & Master Theses
Thank you!
Contact me xmpp://[email protected]
Visit us role-project.eu
Download our SDK sourceforge.net/projects/role-project
Enter our Widget Competition role-project.eu/WidgetCompetition
Join us on LinkedIn linkedin.com/groups?gid=1590487
Share your Learning Widgets role-widgetstore.eu/