Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Open Source XMPP for Cloud Services


Published on

Build next generation cloud services using XMPP and Open Source tools.

Published in: Technology, Education
  • Be the first to comment

Open Source XMPP for Cloud Services

  1. Open Source XMPP for Cloud Services Matt Tucker, CTO Jive Software
  2. Who am I? <ul><li>Member of the XMPP Standards Foundation and former chair of the board </li></ul><ul><li>Behind Smack and Openfire at </li></ul><ul><li>Keep giving talks about XMPP at OSCON… </li></ul>
  4. In This Talk <ul><li>Brief XMPP and cloud computing overview </li></ul><ul><li>Problems in cloud architectures; how XMPP can help </li></ul><ul><li>Open Source tools </li></ul><ul><li>Tips and tricks </li></ul>
  5. XMPP (Jabber) Overview <ul><li>The open protocol for instant messaging (it’s fair to declare victory) </li></ul><ul><li>IETF standard and a robust org developing the protocol: XMPP Standards Foundation </li></ul><ul><li>Simple for developers and very deep Open Source toolset and heritage </li></ul>
  6. XMPP Building Blocks <iq to=‘’ type=‘get’ id=‘123’><query xmlns=‘jabber:weather’><city>pdx</city></query></iq> <iq from=‘’> type=‘result’ id=‘123’><query xmlns=‘jabber:weather’><weather>Not Raining!</weather></query></iq> Exchange information and perform queries using a request / response protocol. IQ <message to='' from='’> <body>How's that presentation going?</body> </message> Send data between users Message <presence from=‘’> <status>Giving a talk...</status> </presence> Send presence data or manage presence subscriptions Presence Example Description
  7. What is Cloud Computing? <ul><li>Predominately based on web services (SOAP, REST, etc) </li></ul><ul><li>Exploding in popularity – a critical trend of software architectures </li></ul><ul><li>Started with simple services; now growing complex </li></ul>
  8. Cloud Service Example: <ul><li>Uses SOAP (not XML-RPC or REST) </li></ul><ul><li>Huge percentage of traffic is polling for updates </li></ul><ul><li>Introduced “Outbound Messaging” to cope with polling – but there are firewall issues </li></ul>
  9. Cloud Architecture Problems <ul><li>Polling doesn’t scale and isn’t real-time </li></ul><ul><li>Need two-way data exchange with easy firewall traversal </li></ul><ul><li>Web services are feature poor (presence, binary data, etc) </li></ul><ul><li>SOAP is what’s needed for complex services, but it’s overly complicated </li></ul><ul><li>Thesis: web services are great for simple cloud services; XMPP is better for complex cloud services </li></ul>
  10. XMPP vs. SOAP Ubiquity Innovative Features Ease Security Performance SOAP XMPP
  11. XMPP Cloud Architecture
  12. Open Source Tools: Server <ul><li>Openfire </li></ul><ul><ul><li>Most popular XMPP server, with over 1 million downloads </li></ul></ul><ul><ul><li>In production with many cloud services </li></ul></ul><ul><ul><li>Massively scalable </li></ul></ul><ul><ul><li>Support for even strict firewall environments -- BOSH </li></ul></ul>
  13. Open Source Tools: Client APIs <ul><li>Dozens of libraries in every major programming language – start at </li></ul><ul><li>Java: Smack library from </li></ul><ul><li>Flex: XIFF library from </li></ul><ul><li>Javascript: JSJac, dojox.xmpp </li></ul>
  14. Open Source Tools: Cloud Components <ul><li>Whack (Java) – simple and high level API </li></ul><ul><li>Components use XEP-114 (easy) </li></ul>
  15. <ul><li>public class ExternalWeatherComponent { </li></ul><ul><li>public static void main(String[] args) { </li></ul><ul><li>ExternalComponentManager manager = </li></ul><ul><li>new ExternalComponentManager(&quot;;, 5275); </li></ul><ul><li>// Set the secret key for this component, for authentication </li></ul><ul><li>manager.setSecretKey(&quot;weather&quot;, &quot;test&quot;); </li></ul><ul><li>// Register this component to a subdomain of the server </li></ul><ul><li>manager.addComponent(&quot;weather&quot;, new WeatherComponent()); </li></ul><ul><li>//... Component will now start processing requests </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  16. <ul><li>public class WeatherComponent implements Component { </li></ul><ul><li>public String getName() { </li></ul><ul><li>return &quot;US Weather&quot;; </li></ul><ul><li>} </li></ul><ul><li>public void processPacket(Packet packet) { </li></ul><ul><li>// Get the request packet here, parse it and return a reply </li></ul><ul><li>} </li></ul><ul><li>public void initialize(JID jid, ComponentManager componentManager) { </li></ul><ul><li>} </li></ul><ul><li>public void shutdown() { </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  17. Example: Clearspace Doc Sharing
  18. Example: Twitter Fire Hose <ul><li>Uses XMPP to provide access to all status updates, which would be impossible using web services polling </li></ul><ul><li>Only provided to a small number of services (most recently Gnip) </li></ul>
  19. Openfire Cloud Services: Tips and Tricks <ul><li>External components allow for hot-deploy of new or updated services </li></ul><ul><li>Run on separate hardware for scalability </li></ul><ul><li>Openfire allows components to connect multiple times for scalability and redundancy </li></ul><ul><li>Epoll on Linux provides great performance </li></ul><ul><li>Ad-hoc command available to listen for all traffic </li></ul><ul><li>Use XMPP federation for federating cloud services </li></ul>
  20. Questions? <ul><li>Blog Entry Link </li></ul><ul><li>Email/IM: [email_address] </li></ul><ul><li> </li></ul>