Present.ly and XMPP

Posted: March 25th, 2009 | Author: skyfallsin
Filed under: code, ruby/rails, xmpp | Tags: , , , , , | Comments

Along with the launch of Presently.com, we quietly revamped the backend architecture of Present.ly to better use the eXtensible Messaging and Presence Protocol (XMPP) as the standard message delivery system. You may have noticed near-instant updates on the new web interface — this is primarily due to the super-fast messaging features of eJabberd, the XMPP server that Present.ly runs on.


We believe that XMPP will play a bigger role powering dynamic, real-time web applications in the coming years and have previously blogged as such. While most people in the industry know of XMPP only in its instant messaging role, the fact that there are fully fleshed out specifications for most common enterprise messaging problems as subsets of the XMPP specification is often sadly overlooked.

So what does this mean for Present.ly? In the short term, as you may have already noticed, you will see a major speed improvement posting and receiving updates. In the long term, we are planning on making our user interface a lot more dynamic — details are top-secret at the moment. We are also working on moving over our notification systems completely to XMPP, which will result in you receiving update notifications more rapidly over all your devices. As we grow, we’ll be leveraging eJabberd’s high scalability (due to it being written in Erlang) to provide a seamless, quick user experience.

We are also actively contributing back to the open-source XMPP community. Read about ruby_bosh, the first Ruby library to handle BOSH sessioning in your Ruby applications. We have also made various stability and speed fixes to the stropheruby library, which is based on the libstrophe C library (announcement soon). Both are available on Github for general use. Intridea’s proud to be a part of the XMPP community, and will be heavily using and promoting the technology with both our products and services.


ruby_bosh - an XMPP BOSH session initializer

Posted: March 1st, 2009 | Author: skyfallsin
Filed under: code, ruby/rails, xmpp | Tags: , , , , , | Comments

Hot on the heels of my post on why XMPP will be huge, here’s a ruby library to pre-initialize BOSH sessions in your Ruby web applications. This feature allows you to by-pass exposing your user’s XMPP credentials in your HTML views.

The process follows as such:

  1. Start your XMPP server and create an account for your web application user.
  2. In your Ruby application, use ruby_bosh to initialize a new BOSH session using the user’s xmpp username and password.
  3. Pass the identifiers returned from ruby_bosh to your template engine as variables.
  4. Bind the template variables to Javascript variables.
  5. Use a Javascript-based BOSH connector (like Strophe) to attach to the pre-existing session using the identifiers.

There are many XMPP servers and BOSH connection managers out there, but as of now this library has only been tested with eJabberd 1.2+. Please feel free to fork and submit a pull request if you’d like to contribute.

The plugins and documentation can be found at: http://www.github.com/skyfallsin/ruby_bosh

Jack Moffit’s written a Django/Python example here.