SlideShare a Scribd company logo
MESSAGING WITH 
AMQP AND RABBITMQ
What is AMQP? 
AMQP (Advanced Message 
Queuing Protocol) is a 
networking protocol that enables 
conforming client applications to 
communicate with conforming 
messaging middleware brokers.
WHAT ARE 
BROKERS 
Messaging brokers receive 
messages from publishers 
(applications that publish them, 
also known as producers) and 
route them to consumers 
(applications that process them).
EXAMPLE OF 
BROKERS 
• RabbitMQ (by VMWARE)! 
• Microsoft's Windows Azure 
Service Bus! 
• Red Hat Enterprise MRG! 
• StormMQ
Lorem Ipsum Dolor 
RABBITMQ Open Source message 
broker / queueing system 
written in Erlang 
implementing AMQP
Who Uses AMQP 
• JPMorgan - 1 billion AMQP messages per day; used in 
dozens of mission critical systems worldwide! 
• VMware - Makes extensive use of RabbitMQ in its 
virtualization products and cloud service! 
• Google! 
• UIDAI, Government of India - the largest online 
identity project in the world aiming to provide each of 
India's 1.2 billion residents with a unique identity 
number! 
• AT&T, Smith Electric Vehicles, Mozilla, RED HAT cloud 
services
Messaging with amqp and rabbitmq
INDUSTRIES Telecommunications, Defense, 
Manufacturing, Internet and 
Cloud Computing
Installing 
RABBitMQ 
• MAC OSX - brew install 
rabbitmq ! 
• Windows - download the 
exe
Running It rabbitmq-server
Enabling the admin 
console 
• rabbitmq-plugins enable 
rabbitmq_management! 
! 
• http://http://localhost: 
15672/
How to talk to 
RABBITMQ An AMQP Client. Available in 
most languages.
Ruby clients • Bunny! 
• Ruby AMQP Gem
INSTALLING 
BUNNY 
• gem install bunny ! 
• add to gem file -> gem 
‘bunny’
Lorem Ipsum Dolor 
AMQP-MODEL 
• messages can be anything,! 
plain text, json, bytes, etc.! 
• Publisher and Consumer 
are typically decoupled in 
big apps
Exchanges and 
Exchange Types 
• Direct exchange - specific 
routing key! 
• Fanout exchange - braodcast! 
• Topic exchange - regex style 
routing key! 
• Headers exchange
DIRECT 
EXCHANGE
Lorem Ipsum Dolor 
DIRECT 
EXCHANGE 2
Lorem Ipsum Dolor 
FAN-OUT 
• leaderboard updates or other 
global events! 
• Sport news sites can use score 
updates to mobile clients in near 
real-time! 
• Group chats can distribute 
messages between participants
Lorem Ipsum Dolor 
TOPIC 
EXCHANGE 
• delimeter is dots! 
• * = 1! 
• # = anything
USING BUNNY 
require “bunny”! 
#connect to rabbitmq! 
conn = Bunny.new! 
conn.start! 
#create channel! 
channel = conn.create_channel! 
#create / subscribe to a queue! 
queue = ch.queue(“hello”)! 
exchange = ch.default_exchange! 
#bind queue to an exchange! 
queue.bind(exchange, :routing_key => 
severity) 
exchange.publish("Hello 
World!", :routing_key => queue.name) 
queue.subscribe(:block => true) do | 
delivery_info, properties, body|! 
puts " [x] Received #{body}"! 
! 
# cancel the consumer to exit! 
delivery_info.consumer.cancel! 
end
DEMO 
code: https://github.com/selasiehanson/rabbitmq_presentaion_code.git
FANOUT 
❖ cd pubsub! 
❖ ruby receive_logs.rb > logs_from_rabbit.log! 
❖ ruby receive_logs.rb! 
❖ ruby emit_log.rb! 
❖ ruby emit_log.rb "Hello my peeps"
DIRECT (3 receivers) 
❖ cd ../routing/! 
❖ ruby receive_logs_direct.rb warning error > 
logs_from_rabbit.log! 
❖ ruby receive_logs_direct.rb info warning error! 
❖ ruby receive_logs_direct.rb info warning! 
❖ ruby emit_log_direct.rb error “Message 1”! 
❖ ruby emit_log_direct.rb warning “Message 2”
TOPIC 
❖ cd ../topic/! 
❖ ruby receive_logs_topic.rb "#"! 
❖ ruby receive_logs_topic.rb "kern.*"! 
❖ ruby receive_logs_topic.rb "*.critical"! 
❖ ruby receive_logs_topic.rb "kern.*" "*.critical"! 
❖ ruby emit_log_topic.rb "kern.critical" "A critical kernel 
error"
THE END
RESOURCES 
❖ http://www.amqp.org/! 
❖ http://www.rabbitmq.com/! 
❖ http://www.rabbitmq.com/getstarted.html! 
❖ http://www.rabbitmq.com/tutorials/amqp-concepts.html! 
❖ http://rubybunny.info/! 
❖ http://rubybunny.info/articles/getting_started.html! 
❖ read the bunny docs! 
❖ http://www.rubyinside.com/rabbitmq-a-fast-reliable-queuing-option-for- 
rubyists-1681.html

More Related Content

What's hot (20)

PDF
[@NaukriEngineering] Messaging Queues
Naukri.com
 
PPTX
Rabbit MQ introduction
Shirish Bari
 
PDF
Messaging Standards and Systems - AMQP & RabbitMQ
POSSCON
 
PPTX
RabbitMq
Ahmad Saif
 
PPTX
The RabbitMQ Message Broker
Martin Toshev
 
PDF
AMQP with RabbitMQ
Spyros Papageorgiou
 
PDF
AMQP for phpMelb
Wee Keat Chin
 
PPTX
Message Broker System and RabbitMQ
University of Alabama at Birmingham
 
PDF
Full Stack Bus with Javascript, RabbitMQ and Postal.js
Javier Arias Losada
 
PDF
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
JAX London
 
PDF
Messaging in the Cloud - AMQP, RabbitMQ and Spring
Eberhard Wolff
 
PDF
Rabbitmq, amqp Intro - Messaging Patterns
Javier Arias Losada
 
PPTX
What is RabbitMQ ?
AIMDek Technologies
 
PDF
An update from the RabbitMQ team - Michael Klishin
RabbitMQ Summit
 
PDF
Rabbitmq basics
Abdriy Mosin
 
PDF
RabbitMQ fairly-indepth
Wee Keat Chin
 
PPTX
High powered messaging with RabbitMQ
James Carr
 
PDF
Rabbitmq an amqp message broker
ANASYS
 
PPTX
Spring RabbitMQ
Martin Toshev
 
PDF
XMPP & AMQP
voluntas
 
[@NaukriEngineering] Messaging Queues
Naukri.com
 
Rabbit MQ introduction
Shirish Bari
 
Messaging Standards and Systems - AMQP & RabbitMQ
POSSCON
 
RabbitMq
Ahmad Saif
 
The RabbitMQ Message Broker
Martin Toshev
 
AMQP with RabbitMQ
Spyros Papageorgiou
 
AMQP for phpMelb
Wee Keat Chin
 
Message Broker System and RabbitMQ
University of Alabama at Birmingham
 
Full Stack Bus with Javascript, RabbitMQ and Postal.js
Javier Arias Losada
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
JAX London
 
Messaging in the Cloud - AMQP, RabbitMQ and Spring
Eberhard Wolff
 
Rabbitmq, amqp Intro - Messaging Patterns
Javier Arias Losada
 
What is RabbitMQ ?
AIMDek Technologies
 
An update from the RabbitMQ team - Michael Klishin
RabbitMQ Summit
 
Rabbitmq basics
Abdriy Mosin
 
RabbitMQ fairly-indepth
Wee Keat Chin
 
High powered messaging with RabbitMQ
James Carr
 
Rabbitmq an amqp message broker
ANASYS
 
Spring RabbitMQ
Martin Toshev
 
XMPP & AMQP
voluntas
 

Similar to Messaging with amqp and rabbitmq (20)

PDF
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Ontico
 
PDF
Scaling applications with RabbitMQ at SunshinePHP
Alvaro Videla
 
PDF
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Tanya Denisyuk
 
PDF
Enterprise Messaging with RabbitMQ.pdf
Ortus Solutions, Corp
 
PDF
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Marian Marinov
 
PPTX
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
Alexandre Brandão Lustosa
 
PDF
Second screen iot_day_stockholm_2014
Steffen Larsen
 
PPTX
FEUC Tec 2016 - Desacoplando WorkFlows com RabbitMQ
Alexandre Brandão Lustosa
 
PDF
Multiply like rabbits with rabbit mq
ColdFusionConference
 
PDF
Multiply like rabbits with rabbit mq
devObjective
 
PDF
CBDW2014 - Down the RabbitMQ hole with ColdFusion
Ortus Solutions, Corp
 
PDF
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Nathan O'Hanlon
 
PPT
Connecting applicationswitha mq
Rob Davies
 
PDF
Enterprise messaging
ColdFusionConference
 
PDF
RabbitMQ with python and ruby RuPy 2009
Paolo Negri
 
PPTX
The bigrabbit
TarjeiRomtveit
 
PDF
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Paolo Negri
 
PPTX
Rabbit MQ
Tran Thanh Thi
 
PDF
Follow the White Rabbit - Message Queues with PHP
Eric Rodriguez (Hiring in Lex)
 
PDF
Multi-platform Enterprise Messaging with RabbitMQ
Ortus Solutions, Corp
 
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Ontico
 
Scaling applications with RabbitMQ at SunshinePHP
Alvaro Videla
 
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Tanya Denisyuk
 
Enterprise Messaging with RabbitMQ.pdf
Ortus Solutions, Corp
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Marian Marinov
 
IoT Service Bus - High availability with Internet of Things (IoT)/ API Rest/ ...
Alexandre Brandão Lustosa
 
Second screen iot_day_stockholm_2014
Steffen Larsen
 
FEUC Tec 2016 - Desacoplando WorkFlows com RabbitMQ
Alexandre Brandão Lustosa
 
Multiply like rabbits with rabbit mq
ColdFusionConference
 
Multiply like rabbits with rabbit mq
devObjective
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
Ortus Solutions, Corp
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Nathan O'Hanlon
 
Connecting applicationswitha mq
Rob Davies
 
Enterprise messaging
ColdFusionConference
 
RabbitMQ with python and ruby RuPy 2009
Paolo Negri
 
The bigrabbit
TarjeiRomtveit
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Paolo Negri
 
Rabbit MQ
Tran Thanh Thi
 
Follow the White Rabbit - Message Queues with PHP
Eric Rodriguez (Hiring in Lex)
 
Multi-platform Enterprise Messaging with RabbitMQ
Ortus Solutions, Corp
 
Ad

Recently uploaded (20)

PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Ad

Messaging with amqp and rabbitmq

  • 1. MESSAGING WITH AMQP AND RABBITMQ
  • 2. What is AMQP? AMQP (Advanced Message Queuing Protocol) is a networking protocol that enables conforming client applications to communicate with conforming messaging middleware brokers.
  • 3. WHAT ARE BROKERS Messaging brokers receive messages from publishers (applications that publish them, also known as producers) and route them to consumers (applications that process them).
  • 4. EXAMPLE OF BROKERS • RabbitMQ (by VMWARE)! • Microsoft's Windows Azure Service Bus! • Red Hat Enterprise MRG! • StormMQ
  • 5. Lorem Ipsum Dolor RABBITMQ Open Source message broker / queueing system written in Erlang implementing AMQP
  • 6. Who Uses AMQP • JPMorgan - 1 billion AMQP messages per day; used in dozens of mission critical systems worldwide! • VMware - Makes extensive use of RabbitMQ in its virtualization products and cloud service! • Google! • UIDAI, Government of India - the largest online identity project in the world aiming to provide each of India's 1.2 billion residents with a unique identity number! • AT&T, Smith Electric Vehicles, Mozilla, RED HAT cloud services
  • 8. INDUSTRIES Telecommunications, Defense, Manufacturing, Internet and Cloud Computing
  • 9. Installing RABBitMQ • MAC OSX - brew install rabbitmq ! • Windows - download the exe
  • 11. Enabling the admin console • rabbitmq-plugins enable rabbitmq_management! ! • http://http://localhost: 15672/
  • 12. How to talk to RABBITMQ An AMQP Client. Available in most languages.
  • 13. Ruby clients • Bunny! • Ruby AMQP Gem
  • 14. INSTALLING BUNNY • gem install bunny ! • add to gem file -> gem ‘bunny’
  • 15. Lorem Ipsum Dolor AMQP-MODEL • messages can be anything,! plain text, json, bytes, etc.! • Publisher and Consumer are typically decoupled in big apps
  • 16. Exchanges and Exchange Types • Direct exchange - specific routing key! • Fanout exchange - braodcast! • Topic exchange - regex style routing key! • Headers exchange
  • 18. Lorem Ipsum Dolor DIRECT EXCHANGE 2
  • 19. Lorem Ipsum Dolor FAN-OUT • leaderboard updates or other global events! • Sport news sites can use score updates to mobile clients in near real-time! • Group chats can distribute messages between participants
  • 20. Lorem Ipsum Dolor TOPIC EXCHANGE • delimeter is dots! • * = 1! • # = anything
  • 21. USING BUNNY require “bunny”! #connect to rabbitmq! conn = Bunny.new! conn.start! #create channel! channel = conn.create_channel! #create / subscribe to a queue! queue = ch.queue(“hello”)! exchange = ch.default_exchange! #bind queue to an exchange! queue.bind(exchange, :routing_key => severity) exchange.publish("Hello World!", :routing_key => queue.name) queue.subscribe(:block => true) do | delivery_info, properties, body|! puts " [x] Received #{body}"! ! # cancel the consumer to exit! delivery_info.consumer.cancel! end
  • 23. FANOUT ❖ cd pubsub! ❖ ruby receive_logs.rb > logs_from_rabbit.log! ❖ ruby receive_logs.rb! ❖ ruby emit_log.rb! ❖ ruby emit_log.rb "Hello my peeps"
  • 24. DIRECT (3 receivers) ❖ cd ../routing/! ❖ ruby receive_logs_direct.rb warning error > logs_from_rabbit.log! ❖ ruby receive_logs_direct.rb info warning error! ❖ ruby receive_logs_direct.rb info warning! ❖ ruby emit_log_direct.rb error “Message 1”! ❖ ruby emit_log_direct.rb warning “Message 2”
  • 25. TOPIC ❖ cd ../topic/! ❖ ruby receive_logs_topic.rb "#"! ❖ ruby receive_logs_topic.rb "kern.*"! ❖ ruby receive_logs_topic.rb "*.critical"! ❖ ruby receive_logs_topic.rb "kern.*" "*.critical"! ❖ ruby emit_log_topic.rb "kern.critical" "A critical kernel error"
  • 27. RESOURCES ❖ http://www.amqp.org/! ❖ http://www.rabbitmq.com/! ❖ http://www.rabbitmq.com/getstarted.html! ❖ http://www.rabbitmq.com/tutorials/amqp-concepts.html! ❖ http://rubybunny.info/! ❖ http://rubybunny.info/articles/getting_started.html! ❖ read the bunny docs! ❖ http://www.rubyinside.com/rabbitmq-a-fast-reliable-queuing-option-for- rubyists-1681.html