The realtime web
EmberJS & XMPP
by Tom Evans & Javier Vega
-
- iFrames, SWF, Comet, …
- BOSH / Long-polling
- Websockets / Sockets.io
Browser “Push” Technology Options
XMPP
Extensible Messaging
and Presence Protocol
XMPP.org
(RFC 6120, RFC 6121, RFC 6122)
XMPP Core concepts
- XML Streams
- Authentication / Authorization
- Presence, Message, IQ
- Roster
- Users & Groups
- Publish-Subscribe (XEP-0060)
Rosters / Groups
BOSH
Bidirectional streams
Over Synchronous Http
XEP-0124 + XEP-0206
Long Polling - HTTP-BIND
XMPP Servers
- Commercial & open source alternatives
- Highly Scalable & Extensible
- Openfire
- Open source (Github)
- Supports federation, clustering
- Easy extensibility/integration via Plugin API
http://igniterealtime.org/projects/openfire/
Use cases
- Presence + Context (online users)
- Distributed events / Data push (P2P, S2C)
- Client cache invalidation
- Application optimization (SOA, UX)
- Client code updates (uptime deployment)
DEMO
Demo Repo
github.com/rjaviervega/ember-xmpp-im
Open Fire Setup
XMPP Connection - StropheJS
Message Handler
Data Models (Ember Data)
Send Message (Update Ember Data)
Additional Links
http://xmpp.org/
http://strophe.im/strophejs/
http://conversejs.org
http://igniterealtime.org/projects/openfire/
Resources
- Book: Professional XMPP Programming with
JavaScript and jQuery (Jack Moffitt)
Contact
- Tom Evans
- Full stack engineer / Openfire core developer
- Github: github.com/tevans
- LinkedIn: linkedin.com/in/tevans
- Twitter: @twe_pf
- twevans@hotmail.com
- Javier Vega
- UI Software Engineer
- github.com/rjaviervega
- linkedin.com/in/rjaviervega
- twitter: @rjaviervega
- rjaviervega@gmail.com

Realtime applications with EmberJS and XMPP

Editor's Notes

  • #2 The real time web is the idea that the browser can be a two way communication channel with very low latency. In this presentation I will talk about technologies that we can use for real time and how we can do this with XMPP I will then show you the implementation we did for the hack day and how we can use XMPP to improve the EHR
  • #3 Multi-player gaming Instant messaging Activity dashboards Team collaborating Document co-editing
  • #4 Stateless Standard HTTP polling is terrible Few “push” alternatives
  • #8 The Extensible Messaging and Presence Protocol (XMPP) is an open technology for real-time communication. It powers a wide range of applications including instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data. Started in 1999 to take on the closed messaging protocols by AOL & Yahoo & ICQ Originally intended for IM replacement, but it can be extended for anything that you would need It was called Jabber Has come under the umbrella of the XMPP Standards Foundation (XSF)
  • #11 BOSH is “Bidirectional-streams Over Synchronous HTTP”, a technology for two-way communication over the Hypertext Transfer Protocol (HTTP). BOSH emulates many of the transport primitives that are familiar from the Transmission Control Protocol (TCP). For applications that require both “push” and “pull” communications, BOSH is significantly more bandwidth-efficient and responsive than most other bidirectional HTTP-based transport protocols and the techniques known as AJAX. BOSH achieves this efficiency and low latency by avoiding HTTP polling, yet it does so without resorting to chunked HTTP responses as is done in the technique known as Comet.
  • #12 Long polling the server is waiting for new data Connection gets re-established right after it closes Where clients and connection managers support persistent connections (i.e. "Connection: keep-alive" from HTTP/1.0, and which is the default state for HTTP/1.1), these sockets remain open for an extended length of time, awaiting the client's next request. This reduces the overhead of socket establishment, which can be very expensive if HTTP over Secure Sockets Layer (SSL) is used.