A note on XMPP communications protocol

    When it comes to messaging, I’ve been interested to know how messaging protocols work such as XMPP (Extensible Messaging and Presence Protocol) communications protocol, which is an open standard for messaging that provides a set of protocols for message exchange based on XML. Applications such as WhatsApp, GoogleTalk and Facebook external chat API to name a few, uses the XMPP protocol (or a customized version of the protocol). While the standards are open, these protocols themselves are complicated and heavyweight with a lot of overhead because of the extensive use of XML. Some application servers such as Ejabberd, Openfire, Tigase, Prosody have implemented these protocols for messaging. Based on the protocols (XEPs) implemented by these XMPP servers, client software/ IM applications can use these protocols for connecting with the servers. You can compare the list of messaging protocols here. When choosing a protocol, many factors come into play. But since more of the messaging happens in real-time, we want to minimize overhead and maintain a steady connection. Scalability, concurrency and reliability plays important roles. Due to this, some of the applications such as GTalk has moved on and replaced by Google Hangouts which uses its own protocols for messaging. However, it is interesting to learn how these protocols work providing insights in handling messages, presence, roster, group sharing, etc. We also have a list of client software and libraries which we can use to connect to the XMPP server. In the next series of posts, I will walk through setting up your own XMPP (Jabber) server and use libraries such as Smack API a Java library for both Android and Java backend and JavaScript libraries such as Strophejs for connecting to your Jabber server. Personally I’ve never used Tigase or Prosody, but when it comes to performance I highly recommend using Ejabberd.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s