RabbitMQ

Post on 05-Jul-2015

884 views 2 download

Transcript of RabbitMQ

Jéferson Machado So#ware  Design  

Social  network  informa0on  

http://twitter.com/jefersonm http://facebook.com/jefe.machado

https://github.com/jefersonm/ http://slideshare.net/jefersonm

WHAT IS THAT ?

Robust messaging for applications

Written in:

LANGUAGES

•  JAVA / JVM – GROOVY / GRAILS – SCALA / LIFT – AKKA – PLAY! FRAMEWORK

•  RUBY •  PYTHON •  .NET •  PHP •  PERL •  C/C++ •  ERLANG •  LISP •  HASKELL

HOW IT WORKS ?

Post man

Producer  

Sent  message  

Consumer  

Receive  message  

Queue  

JARGON

Buffer  that  stores  messages  

WORKER QUEUES

worker.py   new_task.py  

ROUND-ROBIN DISPATCHING

Consumer  1   Consumer  2  

MESSAGE ACKNOWLEDGMENT

Consumer  1   Consumer  2  

Ack  

MESSAGE ACKNOWLEDGMENT

Consumer  1   Consumer  2  

MESSAGE DURABILITY

FAIR DISPATCH

Consumer  1   Consumer  2  

prefetch=1   prefetch=1  

PUBLISH / SUBSCRIBLE

EXCHANGES

Wrong              

Right                

EXCHANGES

TYPES:  

•  Direct  •  Topic  •  Fanout  •  Header  

Default  exchange  

BINDINGS

TEMPORARY QUEUES

amq.gen-­‐U0srCoW8TsaXjNh73pnVAw==  

With  name:  

Random  name:  

ROUNTING

Exchange:  direct  

TOPICS

Exchange:  topic  

Message  =  quick.orange.rabbit  

Message  =  quick.orange.fox  

Message  =  lazy.brown.fox  

Q1,  Q2  

Q1  

Q2  

TOPIC IS MUCH POWERFUL!!!

Message  =  #  

Message  =  no  “#”  (hash)  and  “*”  (star)      

fanout  

direct  

PLUGINS

PLUGINS

REFERENCES

•  http://www.rabbitmq.com/

•  https://github.com/jefersonm/sandbox/tree/gh-pages/python/rabbitmq

Jéferson Machado So#ware  Design  

Social  network  informa0on  

http://twitter.com/jefersonm http://facebook.com/jefe.machado

https://github.com/jefersonm/ http://slideshare.net/jefersonm