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 igniterealtime.org </li></ul><ul><li>Keep giving talks about XMPP at OSCON… </li></ul>
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>
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>
XMPP Building Blocks <iq to=‘weather.jivesoftware.com’
type=‘get’ id=‘123’><query xmlns=‘jabber:weather’><city>pdx</city></query></iq> <iq from=‘weather.jivesoftware.com’> 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='matt@jivesoftware.com' from='gato@igniterealtime.org’> <body>How's that presentation going?</body> </message> Send data between users Message <presence from=‘matt@jivesoftware.com’> <status>Giving a talk...</status> </presence> Send presence data or manage presence subscriptions Presence Example Description
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>
Cloud Service Example: Salesforce.com <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>
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>
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>
Open Source Tools: Client APIs
<ul><li>Dozens of libraries in every major programming language – start at jabber.org </li></ul><ul><li>Java: Smack library from igniterealtime.org </li></ul><ul><li>Flex: XIFF library from igniterealtime.org </li></ul><ul><li>Javascript: JSJac, dojox.xmpp </li></ul>
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>
ExternalWeatherComponent.java <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("example.com", 5275); </li></ul><ul><li>// Set the secret key for this component, for authentication </li></ul><ul><li>manager.setSecretKey("weather", "test"); </li></ul><ul><li>// Register this component to a subdomain of the server </li></ul><ul><li>manager.addComponent("weather", new WeatherComponent()); </li></ul><ul><li>//... Component will now start processing requests </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
WeatherComponent.java <ul><li>public class WeatherComponent implements
Component { </li></ul><ul><li>public String getName() { </li></ul><ul><li>return "US Weather"; </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>
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>
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>
Clipping is a handy way to collect and organize the most important slides from a presentation. You can keep your great finds in clipboards organized around topics.
Be the first to comment