Download - AMQP and RabbitMQ (OKCJUG, January 2014)
![Page 1: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/1.jpg)
AMQP MessagingOKCJUG - January 2014 - Ryan Hoegg
![Page 2: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/2.jpg)
Messaging?
Notify another system
Work queue
Decouple deployments
![Page 3: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/3.jpg)
The Broker
Accepts messages from publishers
Delivers messages to consumers
![Page 4: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/4.jpg)
Queue
XX
![Page 5: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/5.jpg)
Queue
XX
![Page 6: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/6.jpg)
Publish / Subscribe
Consumers can listen when they want
Many consumers could get the message
![Page 7: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/7.jpg)
Open standard for messaging middleware
Defines a networking protocol
Defines semantics of broker services
![Page 8: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/8.jpg)
The Message
Payload (byte[])
Attributes (key/value pairs)
![Page 9: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/9.jpg)
Queue
![Page 10: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/10.jpg)
Queue
![Page 11: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/11.jpg)
Queue
name
attributes
durableexclusiveauto-deletearguments
![Page 12: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/12.jpg)
Exchange
![Page 13: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/13.jpg)
Exchange
name
type
attributes
durableauto-deletearguments
![Page 14: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/14.jpg)
Binding
Rule used by exchange to route messages to a queue
Has optional routing key
![Page 15: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/15.jpg)
Fanout Exchange
Simple pub/sub
Message routed to every queue bound to the exchange
Routing key is ignored
![Page 16: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/16.jpg)
Direct Exchange
Simple point-to-point
Message routed to queue if routing key matches binding exactly
![Page 17: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/17.jpg)
Topic Exchange
Message routed to queue based on routing-key match
Use dots within queue names and wildcards in routing keys
![Page 18: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/18.jpg)
Setting things up
Programmable: clients declare everything
Most servers come with management tools too, though
![Page 19: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/19.jpg)
Version Confusion
AMQP 0.9.1 widely implemented
AMQP 1.0 approved in October
They are very different
![Page 20: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/20.jpg)
Servers
RabbitMQ: http://www.rabbitmq.com/
OpenAMQ: http://www.openamq.org
Apache Qpid: http://qpid.apache.org/
![Page 21: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/21.jpg)
AMQP Alternatives
JMS (ActiveMQ is pretty good)
ZeroMQ
Amazon SQS
IronMQ
pubsubhubbub (RESTful)
redis
![Page 22: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/22.jpg)
![Page 23: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/23.jpg)
Installation
Provides installer for Windows, OSX, several linux distributions, solaris
Uses erlang runtime
![Page 24: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/24.jpg)
Management Plugin
$ rabbitmq-plugins enable rabbitmq_management
![Page 25: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/25.jpg)
Distributed Brokers
Clustering
HA Queues
Federation
Shovel
![Page 26: AMQP and RabbitMQ (OKCJUG, January 2014)](https://reader038.vdocument.in/reader038/viewer/2022102711/554f5fd4b4c905bb178b4648/html5/thumbnails/26.jpg)