I decided to look into XMPP after the last NFJS in Reston, VA. It was a lecture by Brian Sletten that made me realize how powerful this technology could be. Before the lecture my only knowledge of this protocol was that it has something to do with instant messaging. After the lecture I was excited and motivated to look deeper into this protocol. My goal with this post is to give you a general idea of what this protocol is and what it could be used for. As I experiment with different libraries, I will post code examples of how XMPP could be used on your web application.
What is XMPP?
XMPP stands for Extensible Messaging and Presence Protocol. The xmpp.org site defines it as “a set of open XML technologies for presence and real-time communication.” In other words, this is a technology that allows you to send XML from one place to another almost instantly.
How does it work?
As an architecture, XMPP is similar to email in that, not only do they both use a client-server structure, but also, all the different servers are connected to allow cross-domain communication. In essence, just like a user with a @mac address can send a email message to a @gmail account, so can the @gmail user send a XMPP message to a @mac account.
The big difference between email and XMPP is how the connected servers will communicate when a message is being sent. On an email system, the client will connect to the server which will then decide where to forward the message too. This message could be forwarded to multiple servers before it reaches it’s destination. On a XMPP architecture, the client will connect to the Jabber server which will connect directly to the recipient’s server and deliver the message.
To XMPP?
XMPP can be used for many different reasons. Of course we can use it for instant messaging, but what else? One use that seems to be gaining popularity is notifications. Most of the current applications are using RSS like, pull technologies, wasting bandwidth and server resources by having to go and check every so often for new messages (even when there aren’t any new messages to get pulled). Considering that XMPP is a push technology, notifications will be sent instantly when a new message is generated, there is no need to check for it.
Another great use for XMPP could be data transfer. A simple example of this would be an application that allows you to update your twitter account from your instant messaging client.
There are many other things that can be done including, monitoring systems, identifying the presence of users, and even controlling servers from our instant messaging client. In the end its up to our imagination.
Or NOT XMPP?
The biggest reason for not using XMPP is, if you need to guarantee that a user will see the message. With a XMPP architecture, if a recipient’s client application is not running, it is possible that the message will never get to him/her.
If you are interested in XMPP keep checking back as I will be posting tutorials with code examples. If you are still confused on the power of XMPP, check out Google Wave, its somewhat of a cool application
During the last