Introduction To RabbitMQ

Transcription

Introduction to RabbitMQAn open source message broker that just worksAlexis RichardsonMatthias RadestockTony Garnock-JonesCohesiveFT, LShift and RabbitMQGoogle UK25 September 20081

Thank you!RabbitMQ is a messaging server that just works!Im in yr serverz,queueing yr messagezPhoto credit: pyright (c) Rabbit Technologies Ltd.

You might need messaging if . you need to scale3

You might need messaging if . you need to monitor data feeds(CC) Kishore Nagarigari4

You might need messaging if . you need a message delivered responsibly5

You might need messaging if . you need things done in order(CC) David Mach6

You might need messaging if . you are using the cloud7

Messaging is everywhereEnterpriseServiceServiceBusBusPeer NetworkPeerNetworkEnterpriseService NetworkFederationand CloudPipelinePipelineClient/Serverand Hubn' SpokeClient - Server(hub)8copyright (c) Rabbit Technologies Ltd.

Messaging is your friendRoute data from point A to point B (or “pubsub” push to many points C)Decouple publishers and consumersQueueing and buffering for later deliveryAsynchronous “hand off”Load balancing and scalabilityMonitoring and managementFor more on messaging, see this great summary by Bob -need-messaging-if/9copyright (c) Rabbit Technologies Ltd.

Don’t be evilMIDDLEWARELOCK IN10(CC) Giara @flickr.com

When middleware goes badcomplex, proprietary, closedrequires installation and customisationintegration services from consultants withknowledge of many platforms or languagesthen maintenance is done by the customerwhich is then followed by system aging, bloat,and eventual heat death11copyright (c) Rabbit Technologies Ltd.

Beware of lock in12copyright (c) Rabbit Technologies Ltd.

Messaging middleware market is stuck, stuck, stuck5%5%10%80%IBMSonicMQTibcoOther13copyright (c) Rabbit Technologies Ltd.

What about everyone else’s needs?integration5% 5%10%80%cloud andvirtualizationweb applicationsand services14copyright (c) Rabbit Technologies Ltd.

Meet the good guys15

OPEN INTERNET PROTOCOLS - TCP, SCTP, HTTP, SMTP - EPIC WINsimplestandardubiquitous substrateno customisation neededno integration required from consultantsmaintenance is done by the vendorproven to outlast the lifetime of the average software company(and many banks)scales16copyright (c) Rabbit Technologies Ltd.

The world is getting more open every dayThen:Imagine if we had no TCP and had to use ‘IBM NetSphere’Imagine if we had no HTTP and had to use ‘Microsoft Home Network’Imagine if we had no SMTP email and had to pay per message like SWIFTNow:Imagine if we had no XMPP chat and had to use . oh, wait a minute :-(AMQP - business messaging - like email but you can send money over it17copyright (c) Rabbit Technologies Ltd.

Application layer protocols made at goes in herewill clean up if it isOPEN,UBIQUITOUS,& ADAPTABLEcopyright (c) Rabbit Technologies Ltd.

Some key AMQP messaging protocol requirementsInternet protocol - like HTTP, TCP - but ASYNCHRONOUSWHERE TO SEND MESSAGES (Routing)HOW TO GET THERE (Delivery)WHAT GOES IN MUST COME OUT (Fidelity)19copyright (c) Rabbit Technologies Ltd.

AMQP in a nutshell20copyright (c) Rabbit Technologies Ltd.

AMQP lets you program message flows dynamicallyEach message is statelessConsumers create queues; thesebuffer messages for push to consumersQueues are stateful, ordered, and canbe persistent, transient, private, shared.Exchanges are stateless routing tables.Consumers tell queues to bind tonamed exchanges; each binding has apattern e.g. “tony” or “*.ibm.*”Producers send messages to exchangeswith a routing key e.g. “tony”, orordered set of keys e.g. “buy.ibm.nyse”Exchanges route messages to queueswhose binding pattern matches themessage routing key or keys21copyright (c) Rabbit Technologies Ltd.

Example: using bindings for twitter style pubsub message flow“is atwork”EvanTony publishes the message“is at work” to the sameRabbitMQ exchange, usingthe routing key “tony”.“is atwork”Tony“is atwork”“is atwork”“is atwork”Evan and Anders want tofollow what Tony says. Theycan follow Tony by bindingtheir queues to aRabbitMQ exchange, usingthe pattern “tony”.AndersThe exchange updatesEvan’s and Anders’ queuesaccordingly, for subsequentconsumption by their clientapplications.Many other patterns arepossible e.g. for filtering bytopic similar to this: http://jchris.mfdz.com/posts/6422copyright (c) Rabbit Technologies Ltd.

Producers and consumers logically interact through a broker cloud23copyright (c) Rabbit Technologies Ltd.

Critical path logical path24copyright (c) Rabbit Technologies Ltd.

Developed by a Working Group of Users (yay!) as well as Vendors (boo.)25copyright (c) Rabbit Technologies Ltd.

RabbitMQ26copyright (c) Rabbit Technologies Ltd.

RabbitMQ - NOM NOM NOM“RabbitMQ is a pleasure to use and it just works.Everyday, every time, every message” - MichaelArnoldus, project lead, algo trading firm“In my experience, you can have a clustered rabbitmq setuprunning at home in under 20 minutes. It's all in the admin guide.”Steve Jenson, co-founder of Blogger27copyright (c) Rabbit Technologies Ltd.

RabbitMQ is for everyone28copyright (c) Rabbit Technologies Ltd.

RabbitMQ is fast29

STOP - LOOK - LISTEN - THINK(CC) Javic @flickr.com30

STOP - LOOK - LISTEN - THINKClustered, highly available messaging is complex - don’t build this at homeGet RabbitMQ - it takes a couple of minutes to set up and JUST WORKSRabbitMQ began in 2006 - first release Feb 2007 - four more releases sinceComplete, conformant and interoperable implementation of the AMQP specRabbitMQ is FREE to use - open source MPL license - prolificSUPPORTED commercially“Ready to run” bundles install in minutes on most platforms (and the cloud)Several extensions - HTTP, STOMP, XMPP, . (PB?)31copyright (c) Rabbit Technologies Ltd.

Show me some !!@ link lovehttp://www.rabbitmq.com (product, documentation and mailing list)http://hg.rabbitmq.com/ (open source repositories)Run RabbitMQ right now on EC2 or a VM: http://es.cohesiveft.com/site/rabbitmqJump page for Ruby and Python fans: n to AMQP, use cases and RabbitMQ community, from Dmitriy Samovskiy of the CohesiveFTElastic Server team: qp-messaging-with-rabbitmq/Infovore: http://del.icio.us/alexisrichardson/rabbitmqWhat people are saying: http://search.twitter.com/search?q rabbitmq and IRC #rabbitmq on freenodeRabbitMQ blogs: itmq/ has detail from today on AMQP,erlang, and XMPP. Then http://hopper.squarespace.com/blog/category/amqp has many client examplesAMQP 1.0 users charter and scope: http://jira.amqp.org/confluence/display/AMQP/User SIG andbackground interviews: -ibms-mom-monopolypart-1.html . and some experimental community work: http://wiki.amqp.org/32copyright (c) Rabbit Technologies Ltd.

Join the project!33

Imagine if we had no SMTP email and had to pay per message like SWIFT Now: Imagine if we had no XMPP chat and had to use . oh, wait a minute :-(AMQP - business messaging - like email but you can send money over it 17 copyright (c) Rabbit Tec