44
Interoperability with RabbitMQ by Alvaro Videla at Shanda Innovation - March 2010 Thursday, March 18, 2010

Interoperability With RabbitMq

Embed Size (px)

DESCRIPTION

Presentation held at Shanda Innovation offices in Shanghai, March 2010.

Citation preview

Page 1: Interoperability With RabbitMq

Interoperability with RabbitMQ

by Alvaro Videlaat Shanda Innovation - March 2010

Thursday, March 18, 2010

Page 2: Interoperability With RabbitMq

About Me

• Lead Developer at TheNetCircle.com

• Twitter: @old_sound

• Blog: http://obvioushints.blogspot.com/

• 老外

Thursday, March 18, 2010

Page 3: Interoperability With RabbitMq

The Interoperability

Problem

Thursday, March 18, 2010

Page 4: Interoperability With RabbitMq

The Problem

MoviePublisher

Thursday, March 18, 2010

Page 5: Interoperability With RabbitMq

The Problem

NewMovie

MoviePublisher

Thursday, March 18, 2010

Page 6: Interoperability With RabbitMq

The ProblemWebService

XMLJava

NewMovie

MoviePublisher

Thursday, March 18, 2010

Page 7: Interoperability With RabbitMq

The ProblemWebService

XML

Image ThumbnailGenerator

C++

Java

NewMovie

MoviePublisher

Thursday, March 18, 2010

Page 8: Interoperability With RabbitMq

The ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

C++

PHP

Java

NewMovie

MoviePublisher

Thursday, March 18, 2010

Page 9: Interoperability With RabbitMq

The ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

StaticHTML

Publisher

C++

PHP

PHP

Java

NewMovie

MoviePublisher

Thursday, March 18, 2010

Page 10: Interoperability With RabbitMq

The ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

StaticHTML

Publisher

C++

PHP

PHP

Java

TrailersGenerator

PHP

NewMovie

MoviePublisher

Thursday, March 18, 2010

Page 11: Interoperability With RabbitMq

SYSTEMSThe ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

TrailersGenerator

StaticHTML

Publisher

Thursday, March 18, 2010

Page 12: Interoperability With RabbitMq

SYSTEMSThe ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

TrailersGenerator

StaticHTML

Publisher

Written In Different Languages

Thursday, March 18, 2010

Page 13: Interoperability With RabbitMq

SYSTEMSThe ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

TrailersGenerator

StaticHTML

Publisher

Written In Different Languages

Different Operating Systems

Thursday, March 18, 2010

Page 14: Interoperability With RabbitMq

SYSTEMSThe ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

TrailersGenerator

StaticHTML

Publisher

Written In Different Languages

Different Operating Systems

Written By Different People

Thursday, March 18, 2010

Page 15: Interoperability With RabbitMq

SYSTEMSThe ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

TrailersGenerator

StaticHTML

Publisher

Written In Different Languages

Different Operating Systems

Written By Different People

They Need To Share Information

Thursday, March 18, 2010

Page 16: Interoperability With RabbitMq

SYSTEMSThe ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

TrailersGenerator

StaticHTML

Publisher

Written In Different Languages

Different Operating Systems

Written By Different People

They Need To Share Information

They Need Real Time Data

Thursday, March 18, 2010

Page 17: Interoperability With RabbitMq

SYSTEMSThe ProblemWebService

XML

Image ThumbnailGenerator

PHP CacheGenerator

TrailersGenerator

StaticHTML

Publisher

Written In Different Languages

Different Operating Systems

Written By Different People

They Need To Share Information

They Need Real Time Data

They Need To Scale

Thursday, March 18, 2010

Page 18: Interoperability With RabbitMq

Is There a Solution?

Thursday, March 18, 2010

Page 19: Interoperability With RabbitMq

AMQPand

RabbitMQ

Thursday, March 18, 2010

Page 20: Interoperability With RabbitMq

AMQP

• Advanced Message Queuing Protocol

• Suits Interoperability

• Completely Open Protocol

• Binary Protocol

• AMQP Model

• AMQP Wire Format

Thursday, March 18, 2010

Page 21: Interoperability With RabbitMq

AMQP Model

• Exchanges

• Message Queues

• Bindings

• Rules for binding them

Thursday, March 18, 2010

Page 22: Interoperability With RabbitMq

AMQP Wire Protocol

• Functional Layer

• Transport Layer

Thursday, March 18, 2010

Page 23: Interoperability With RabbitMq

Message Flow

http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.0/html/Messaging_Tutorial/chap-Messaging_Tutorial-Initial_Concepts.html

Thursday, March 18, 2010

Page 24: Interoperability With RabbitMq

Exchange Types

• Fanout

• Direct

• Topic

Thursday, March 18, 2010

Page 25: Interoperability With RabbitMq

Default Exchanges

• amqp.fanout

• amqp.direct

• amqp.topic

Thursday, March 18, 2010

Page 29: Interoperability With RabbitMq

Sample usage

Thursday, March 18, 2010

Page 30: Interoperability With RabbitMq

Sample Usage II

Thursday, March 18, 2010

Page 31: Interoperability With RabbitMq

Other Advantages

• Fire and Forget

• Stop/Start consumers safely (no need for last processed id)

• No need for Cronjobs locks

• Load Distribution

• Transactions

Thursday, March 18, 2010

Page 32: Interoperability With RabbitMq

RabbitMQ

Thursday, March 18, 2010

Page 33: Interoperability With RabbitMq

RabbitMQ

• Enterprise Messaging System

• Open Source MPL

• Written in Erlang/OTP

• Commercial Support

Thursday, March 18, 2010

Page 34: Interoperability With RabbitMq

Features

• Reliable and High Scalable

• Easy To install

• Easy To Cluster

• Runs on: Windows, Solaris, Linux, OSX

• AMQP 0.8

Thursday, March 18, 2010

Page 35: Interoperability With RabbitMq

Client Libraries

• Java

• .NET/C#

• Erlang

• Ruby, Python, PHP, Perl, AS3, Lisp, Scala

Thursday, March 18, 2010

Page 36: Interoperability With RabbitMq

Docs/Support

• http://www.rabbitmq.com/documentation.html

• http://dev.rabbitmq.com/wiki/

• #rabbitmq at irc.freenode.net

• http://www.rabbitmq.com/email-archive.html

Thursday, March 18, 2010

Page 37: Interoperability With RabbitMq

Our Setup:

Publishers - 28 PHP Frontend Machines

2 PHP Machinesrunning 8 consumers each

Thursday, March 18, 2010

Page 38: Interoperability With RabbitMq

Our Setup

• Deployed in mid 2009

• Reduced site SPOF

• 400.000+ messages routed a day (and increasing)

• Very easy to install/deploy

Thursday, March 18, 2010

Page 39: Interoperability With RabbitMq

Easy To Install?

Thursday, March 18, 2010

Page 40: Interoperability With RabbitMq

Easy To Install?

http://gist.github.com/334219

Thursday, March 18, 2010

Page 41: Interoperability With RabbitMq

Show me the code!

Thursday, March 18, 2010

Page 43: Interoperability With RabbitMq

Questions?

Thursday, March 18, 2010

Page 44: Interoperability With RabbitMq

Thanks!Alvaro Videla

http://twitter.com/old_sound

http://www.slideshare.net/old_sound

Thursday, March 18, 2010