open source xmpp for cloud services

20
Open Source XMPP for Cloud Services Matt Tucker, CTO Jive Software

Upload: rafal

Post on 15-Jan-2016

51 views

Category:

Documents


0 download

DESCRIPTION

Open Source XMPP for Cloud Services. Matt Tucker, CTO Jive Software. Who am I?. Member of the XMPP Standards Foundation and former chair of the board Behind Smack and Openfire at igniterealtime.org Keep giving talks about XMPP at OSCON…. In This Talk. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Open Source XMPP for  Cloud Services

Open Source XMPP for Cloud ServicesMatt Tucker, CTO Jive Software

Page 2: Open Source XMPP for  Cloud Services

Who am I?

Member of the XMPP Standards Foundation and former chair of the board

Behind Smack and Openfire at igniterealtime.org

Keep giving talks about XMPP at OSCON…

Page 3: Open Source XMPP for  Cloud Services
Page 4: Open Source XMPP for  Cloud Services

In This Talk

Brief XMPP and cloud computing overview

Problems in cloud architectures; how XMPP can help

Open Source tools

Tips and tricks

Page 5: Open Source XMPP for  Cloud Services

XMPP (Jabber) Overview

The open protocol for instant messaging (it’s fair to declare victory)

IETF standard and a robust org developing the protocol: XMPP Standards Foundation

Simple for developers and very deep Open Source toolset and heritage

Page 6: Open Source XMPP for  Cloud Services

XMPP Building Blocks

Description Example

Presence Send presence data or manage presence subscriptions

<presence from=‘[email protected]’>

<status>Giving a talk...</status>

</presence>

Message Send data between users

<message to='[email protected]'

from='[email protected]’>

<body>How's that presentation going?</body>

</message>

IQ Exchange information and perform queries using a request / response protocol.

<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>

Page 7: Open Source XMPP for  Cloud Services

What is Cloud Computing?

Predominately based on web services (SOAP, REST, etc)

Exploding in popularity – a critical trend of software architectures

Started with simple services; now growing complex

Page 8: Open Source XMPP for  Cloud Services

Cloud Service Example: Salesforce.com

Uses SOAP (not XML-RPC or REST)

Huge percentage of traffic is polling for updates

Introduced “Outbound Messaging” to cope with polling – but there are firewall issues

Page 9: Open Source XMPP for  Cloud Services

Cloud Architecture Problems

Polling doesn’t scale and isn’t real-time

Need two-way data exchange with easy firewall traversal

Web services are feature poor (presence, binary data, etc)

SOAP is what’s needed for complex services, but it’s overly complicated

Thesis: web services are great for simple cloud services; XMPP is better for complex cloud services

Page 10: Open Source XMPP for  Cloud Services

XMPP vs. SOAP

XMPP SOAP

Performance

Security

Ease

Innovative Features

Ubiquity

Page 11: Open Source XMPP for  Cloud Services

XMPP Cloud Architecture

Page 12: Open Source XMPP for  Cloud Services

Open Source Tools: Server

Openfire Most popular XMPP server, with over 1 million

downloads

In production with many cloud services

Massively scalable

Support for even strict firewall environments -- BOSH

Page 13: Open Source XMPP for  Cloud Services

Open Source Tools: Client APIs

Dozens of libraries in every major programming language – start at jabber.org

Java: Smack library from igniterealtime.org

Flex: XIFF library from igniterealtime.org

Javascript: JSJac, dojox.xmpp

Page 14: Open Source XMPP for  Cloud Services

Open Source Tools: Cloud Components

Whack (Java) – simple and high level API

Components use XEP-114 (easy)

Page 15: Open Source XMPP for  Cloud Services

ExternalWeatherComponent.java

public class ExternalWeatherComponent {

public static void main(String[] args) {

ExternalComponentManager manager =

new ExternalComponentManager("example.com", 5275);

// Set the secret key for this component, for authentication

manager.setSecretKey("weather", "test");

// Register this component to a subdomain of the server

manager.addComponent("weather", new WeatherComponent());

//... Component will now start processing requests

}

}

Page 16: Open Source XMPP for  Cloud Services

WeatherComponent.java

public class WeatherComponent implements Component {

public String getName() {

return "US Weather";

}

public void processPacket(Packet packet) {

// Get the request packet here, parse it and return a reply

}

public void initialize(JID jid, ComponentManager componentManager) {

}

public void shutdown() {

}

}

Page 17: Open Source XMPP for  Cloud Services

Example: Clearspace Doc Sharing

Page 18: Open Source XMPP for  Cloud Services

Example: Twitter Fire Hose

Uses XMPP to provide access to all status updates, which would be impossible using web services polling

Only provided to a smallnumber of services (mostrecently Gnip)

Page 19: Open Source XMPP for  Cloud Services

Openfire Cloud Services: Tips and Tricks

External components allow for hot-deploy of new or updated services

Run on separate hardware for scalability

Openfire allows components to connect multiple times for scalability and redundancy

Epoll on Linux provides great performance

Ad-hoc command available to listen for all traffic

Use XMPP federation for federating cloud services