Multiply Like Rabbits with
RabbitMQ
WHO AM I?
• Luis Majano
• Born in El Salvador ------------------>
• Architecture + Software Design
• CEO of Ortus Solutions
• Adobe Community Professional
• Creator of all things Box: 

ColdBox, ContentBox, CommandBox....
AGENDA
• Traditional RPC Calls
• What is Messaging all about
• Different Implementations
• AMQP Protocol
• RabbitMQ
• Demo
TRADITIONAL RPC STYLE CALLS
Obj Obj
Obj
• Blocks Requests
• Asynchronous, partial solution, still 1-1 relationship
• Sender always knows about receiver
• Receiver knows about sender
PROBLEMS WITH RPC
How can we decouple knowledge?
How can we apply messaging patterns to our apps?
Messaging (EMB)
Producer
Consumer Consumer Consumer
Messaging Bus - Broker
Can be
any system or
language
Can be
any system or
language
Doesn’t
care about
consumers
Asynchronous
Does not get a
response
• Producers lack knowledge -> Decouple
• Cross platforms-technologies -> Flexibility
• Event Driven Programming -> Scalability
• Queueing for later delivery
• Asynchronous
• Load balancing
• Hulkyfied services
Usages and Patterns
Direct Messaging
Work Queues
Publish/Subscribe
Topics/Routing
Protocols
JMS AMQP STOMP
AMQP - www.amqp.org
• Advanced Message Queuing Protocol
• != JMS
• Standard binary protocol
• Exchanges
• Queuing
• Routing
• Reliable
• Secure
• Several Implementations
RabbitMQ
ActiveMQ
Qpid
StormMQ
AMQP Messaging Broker
Erlang
Extremely fast, reliable and secure
Languages: c#, erlang, java, python, ruby, node, etc
Accepts and forwards messages
Its like a post box, post office and postman
HOW IT WORKS?
Producer
Message
(Body+Routing Key)
Exchange (Bindings via Routing Key)
Body = binary, json,
anything
stock.

prices
stock.

run
log.

error
cluster
Queues are bound to exchanges with patterns
Routing key =
Bindings
Queues
• Direct
• Routing key = queue name
• No mapping or extra fluff just a passthrough
• Similar to JMS
• Topic
• Binding pattern (routing key) is match against the queue name
• Not full regex
• Ex: log.*, log#
• Not like JMSTopics, forget JMS, this is not JMS
• Fanout + More
EXCHANGETYPES
LOAD BALANCING + ACK
Worker
Queue
Consumer
Consumer
Consumer
Messages are
round-robin
to each
consumer
Consumer
need to ack
DEMOTIME
• Java Producer
• Java Consumer
• CFML Consumer
• NodeJS Consumer
• JavaScript Consumer
• CFML Producer
Q & A
• RabbitMQ In Action Book
• http://www.rabbitmq.com
• http://tryrabbitmq.com/
• https://github.com/RabbitMQSimulator/RabbitMQSimulator
• http://koo.fi/blog/2013/02/18/web-messaging-with-rabbitmq-web-stomp-and-
sockjs/
• https://github.com/robharrop/presentations.git

Multiply like rabbits with rabbit mq

  • 1.
    Multiply Like Rabbitswith RabbitMQ
  • 2.
    WHO AM I? •Luis Majano • Born in El Salvador ------------------> • Architecture + Software Design • CEO of Ortus Solutions • Adobe Community Professional • Creator of all things Box: 
 ColdBox, ContentBox, CommandBox....
  • 3.
    AGENDA • Traditional RPCCalls • What is Messaging all about • Different Implementations • AMQP Protocol • RabbitMQ • Demo
  • 4.
    TRADITIONAL RPC STYLECALLS Obj Obj Obj
  • 6.
    • Blocks Requests •Asynchronous, partial solution, still 1-1 relationship • Sender always knows about receiver • Receiver knows about sender PROBLEMS WITH RPC How can we decouple knowledge? How can we apply messaging patterns to our apps?
  • 7.
    Messaging (EMB) Producer Consumer ConsumerConsumer Messaging Bus - Broker Can be any system or language Can be any system or language Doesn’t care about consumers Asynchronous Does not get a response
  • 8.
    • Producers lackknowledge -> Decouple • Cross platforms-technologies -> Flexibility • Event Driven Programming -> Scalability • Queueing for later delivery • Asynchronous • Load balancing • Hulkyfied services
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
    AMQP - www.amqp.org •Advanced Message Queuing Protocol • != JMS • Standard binary protocol • Exchanges • Queuing • Routing • Reliable • Secure • Several Implementations RabbitMQ ActiveMQ Qpid StormMQ
  • 16.
    AMQP Messaging Broker Erlang Extremelyfast, reliable and secure Languages: c#, erlang, java, python, ruby, node, etc Accepts and forwards messages Its like a post box, post office and postman
  • 17.
    HOW IT WORKS? Producer Message (Body+RoutingKey) Exchange (Bindings via Routing Key) Body = binary, json, anything stock.
 prices stock.
 run log.
 error cluster Queues are bound to exchanges with patterns Routing key = Bindings Queues
  • 18.
    • Direct • Routingkey = queue name • No mapping or extra fluff just a passthrough • Similar to JMS • Topic • Binding pattern (routing key) is match against the queue name • Not full regex • Ex: log.*, log# • Not like JMSTopics, forget JMS, this is not JMS • Fanout + More EXCHANGETYPES
  • 19.
    LOAD BALANCING +ACK Worker Queue Consumer Consumer Consumer Messages are round-robin to each consumer Consumer need to ack
  • 20.
    DEMOTIME • Java Producer •Java Consumer • CFML Consumer • NodeJS Consumer • JavaScript Consumer • CFML Producer
  • 21.
    Q & A •RabbitMQ In Action Book • http://www.rabbitmq.com • http://tryrabbitmq.com/ • https://github.com/RabbitMQSimulator/RabbitMQSimulator • http://koo.fi/blog/2013/02/18/web-messaging-with-rabbitmq-web-stomp-and- sockjs/ • https://github.com/robharrop/presentations.git