3. What is XMPP?
• eXtensible Messaging and Presence Protocol
• Message-oriented middleware
• XML-based
• Various XMPP servers (eJabberd, Openfire, Tigase)
• Most known for being the backend for IM systems
• xmpp.org
4. The GOOD
• Open
• Standardized by the IETF
• Decentralized
• Mature
• Customizable
• FAST!
5. The BAD
• XML is very verbose
• Documentation is not outlined properly
• though there are efforts to make this better
• Lots of presence data overhead on larger
networks
• No unmodified binary data transfers
6. A Simple XMPP Stanza
JID resource
<message from=’pradeep@xmpp.org/adium’
to=’zana@xmpp.org’>
<body>This is a message</body>
</message>
7. Some XMPP Features
• Presence
• Instant Messaging
• Publish/Subscribe
• Multi-User Chat
• Federation
• Personal Eventing, and many more...
10. Publish / Subscribe
• Federated Microblogging using the Personal
Eventing Protocol (PEP)
• Real-time search
• Real-time topic-tracking via multiple
communication channels (RSS, IM etc.)
• Real-time collaborative editing
11. Real-time User Interfaces
• BOSH
• Robust, lively interfaces for daily use
• Javascript-based XMPP clients
• Handlers attached to various XMPP stanzas
• Present.ly, drop.io
13. XMPP4R
•gem install ln-xmpp4r
• very full-featured
• threaded, event-based
• BAD: a lack of documentation, steep
learning curve
• Interfacing with Rails app requires an
external daemon
14. strophe-ruby
• gem install yong-stropheruby
• based off libstrophe, a C library
• event-based
• can be run within a Rails app with proper
timeouts and exception handling
• new release soon
• LOOKING FOR CONTRIBUTORS!
16. BOSH
• Bi-directional streams Over Synchronous HTTP
• This is not COMET, which requires a single
persistent connection
• Session persists over multiple connections
• Full-formed HTTP requests, so works with
most proxies
17. BOSH
client <body/>, session
BOSH
connection no <body/>
manager
XMPP
server
18. Strophe
• Excellent Javascript BOSH client
• written by Jack Moffit (metajack.im)
• written for Chesspark
• used in production at Present.ly
• very, very awesome.
19. Strophe
connection = new Strophe.Connection(“/http-bind”);
connection.connect(“pradeep@xmpp.org”, “password”,
onConnect);
// this calls onMessage for each <message/> stanza
connection.addHandler(onMessage, null, ‘message’,
null, null, null);
// this calls onPubsubEvent every time there’s a message
// from a PubSub node
connection.addHandler(onPubsubEvent,
'http://jabber.org/protocol/pubsub#event', 'message',
null, null, null);
26. XMPP Servers
• eJabberd
• written in Erlang, highly scalable, actively maintained
• runs in production on Present.ly, Chesspark
• Jabberd2
• written in C, actively maintained
• Tigase
• written in Java, actively maintained
• runs in production on Seesmic
• Openfire
• written in Java, actively maintained
• large community, lots of plugins. good for basic XMPP apps
• Prosody
• written in Lua, very new, claims to be lightweight