SlideShare a Scribd company logo
1
2
Agenda
• What is & Why RabbitMQ
• RabbitMQ & AMQP
• Demo
• Application Architectures
• Q&A
3
Show RabbitMQ management console
What & Why
4
• Open source, lightweight message broker
• Flexible configurations to control message delivering behavior
• Third-party plugin support
• Integrated Security
• Platform neutral AMQP implementation with many programming language
support as client
Publish
C
RabbitMQ & AMQP
5
• RabbitMQ implements the AMQP protocol
• We have to speak AMQP to work with RabbitMQ
• Like OOP, AMQP has classes and methods - AMQP commands
• Knowing AMQP will be a definite help when working client libraries
• AMQP commands marshal into frames
App
Client
Image Ref: https://www.brianstorti.com/speaking-rabbit-amqps-frame-structure/
Start conversation
6
Publish a message
7
AMQP model
8
Ref: https://www.rabbitmq.com/tutorials/amqp-concepts.html#amqp-model
Connection vs Channel
9
• Keep one Connection to RabbitMQ
• Create Channel to transmit information
• A single AMQP connection can have multiple channels
Client
Declaring an Exchange
10
• Exchange is responsible for message routing
• Routing algorithm will be based on the exchange type
• Exchanges are created using the Exchange.Declare command, Once the
command has been sent and RabbitMQ has created the exchange, an
Exchange.DeclareOk method frame is sent in response, if error Channel.Close
• PHP - $channel->exchange_declare()
• JAVA - channel.exchangeDeclare()
• JavaScript - ch.assertExchange()
Declaring a Queue
11
• Queues used to store actual data
• Created using Queue.Declare command, returning Queue.DeclareOK. if there
are any errors close the channel.
• Params: queueName, durable, exclusive, autoDelete
• Java - channel.queueDeclare()
• C# - channel.QueueDeclare()
• PHP - $channel->queue_declare()
Bind a Queue
12
• Bind using Queue.Bind command and return Queue.BindOk
• Bind a Queue to an Exchange
• Params: queueName, exchange,routingKey
• Java - channel.queueBind()
• Python - channel.queue_bind
AMQP Model in nutshell
13
• Exchange.Declare
• Queue.Declare
• Queue.Bind
Exchange types
14
• Direct exchange - Delivers messages to queues based on the message routing
key. Default exchange is direct exchange with no name (Empty string)
• Fanout exchange - Routes messages to all the queues that are bound to it and
the routing key is ignored.
• Topic exchange - Route messages to one or many queues based on pattern
matching between a message routing key and binding
• Headers exchange - Uses message headers and ignore routing keys
Reading a Queue & Acknowledgement
15
• Use Basic.Consume command, this is a push modal
• Basic.Ack used to confirm or can use auto acknowledgement when Binding
• When no_ack set to true, RabbitMQ will send messages continuously until
the consumer sends a Basic.Cancel command or the consumer is
disconnected.
• If the no_ack flag is set to false, a consumer must acknowledge each message
that it receives by sending a Basic.Ack
Client
Consume
Ack
Let’s start the demo
16
• Get start with RabbitMQ
• Run RabbitMQ as a docker instance
• Use default exchange to publish & consume
• Demo - face detection application
• RabbitMQ in AWS EC2 – Remote
• Image uploader in AWS
• Image processor in local machine
docker run -d --hostname my-rabbit --name some-rabbit -p 5672:5672 -p 8282:15672 rabbitmq:3-management
Demo..
17
Image
Processor
(OpenCV)
App
Local
AWS
Demo..
18
Web App
FaceDetection
p-Img-request
p-Img-response
FD-R-Q
Key: FD-R-Q
C
Key: detect-faces
FaceDetection
DesktopApp
(OpenCV)
I-W-PID
Key: detect-faces
C
Exchanges
Queues
CQueueConsumber
Architectural choices
19
• Tightly coupled application
• Decouple DB updates
Application DB
Application
DB
Architectural choices..
20
• Add new features
Application
C1
DB
C2
Another
System
Architectural choices..
21
• Replication Application
DB
C
DB
C
Architectural choices..
22
Application
DB
C
DB
C
Application
Architectural choices
23
• Loosely coupled components
• Realtime and Reactive capabilities
• Improve scalability of applications
• Easy and seamless adding of new features
• Replication of data, events or even full application
Q & A
24
• Thank you!!
Ref
25
https://www.rabbitmq.com/getstarted.html
RabbitMQ in Depth by Gavin

More Related Content

PDF
Distributed messaging with AMQP
PDF
What we've learned from running thousands of production RabbitMQ clusters - L...
PDF
AMQP for phpMelb
PDF
An update from the RabbitMQ team - Michael Klishin
PDF
Messaging with RabbitMQ and AMQP
PDF
Introduction to AMQP Messaging with RabbitMQ
PPT
Amqp Basic
PDF
Messaging Standards and Systems - AMQP & RabbitMQ
Distributed messaging with AMQP
What we've learned from running thousands of production RabbitMQ clusters - L...
AMQP for phpMelb
An update from the RabbitMQ team - Michael Klishin
Messaging with RabbitMQ and AMQP
Introduction to AMQP Messaging with RabbitMQ
Amqp Basic
Messaging Standards and Systems - AMQP & RabbitMQ

What's hot (20)

PPTX
What is RabbitMQ ?
PDF
Messaging with amqp and rabbitmq
PPT
Easy enterprise application integration with RabbitMQ and AMQP
PDF
AMQP with RabbitMQ
PPTX
The RabbitMQ Message Broker
ODP
Introduction To RabbitMQ
PPTX
Message Broker System and RabbitMQ
PDF
The Future of Messaging: RabbitMQ and AMQP
PDF
Full Stack Bus with Javascript, RabbitMQ and Postal.js
PDF
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
KEY
Real time system_performance_mon
PDF
Messaging Standards and Systems - AMQP & RabbitMQ
PDF
RabbitMQ fairly-indepth
PPTX
Spring RabbitMQ
PDF
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
PDF
Integrating PostgreSql with RabbitMQ
PDF
[@NaukriEngineering] Messaging Queues
PDF
A Closer Look at RabbitMQ
PDF
XMPP & AMQP
KEY
RabbitMQ And Nanite
What is RabbitMQ ?
Messaging with amqp and rabbitmq
Easy enterprise application integration with RabbitMQ and AMQP
AMQP with RabbitMQ
The RabbitMQ Message Broker
Introduction To RabbitMQ
Message Broker System and RabbitMQ
The Future of Messaging: RabbitMQ and AMQP
Full Stack Bus with Javascript, RabbitMQ and Postal.js
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Real time system_performance_mon
Messaging Standards and Systems - AMQP & RabbitMQ
RabbitMQ fairly-indepth
Spring RabbitMQ
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Integrating PostgreSql with RabbitMQ
[@NaukriEngineering] Messaging Queues
A Closer Look at RabbitMQ
XMPP & AMQP
RabbitMQ And Nanite
Ad

Similar to RabbitMQ and AMQP Model (20)

PPTX
RabbitMQ and AMQP with .net client library
PPTX
zeromq
PDF
Multi-language/multi-OS communication using RabbitMQ
PDF
ITB2019 Multi-language / multi-OS communication using RabbitMQ - Wil de Bruin
PPTX
Spring RabbitMQ
PDF
Enterprise Messaging with RabbitMQ.pdf
PPTX
Mumbai MuleSoft Meetup #20
PDF
HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen...
PPTX
Picking a message queue
PPTX
Introducing MQ Light - IBM Interconnect 2015 session AME4181
PDF
Introduction MQTT in English
PDF
quickguide-einnovator-3-rabbitmq
PDF
MuleSoft Surat Meetup#55 - Unleash the power of Anypoint MQ
PDF
Rabbitmq basics
PDF
Messaging for Modern Applications
PDF
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
PPTX
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
PDF
Multi-platform Enterprise Messaging with RabbitMQ
PPTX
Pika driver
RabbitMQ and AMQP with .net client library
zeromq
Multi-language/multi-OS communication using RabbitMQ
ITB2019 Multi-language / multi-OS communication using RabbitMQ - Wil de Bruin
Spring RabbitMQ
Enterprise Messaging with RabbitMQ.pdf
Mumbai MuleSoft Meetup #20
HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Cen...
Picking a message queue
Introducing MQ Light - IBM Interconnect 2015 session AME4181
Introduction MQTT in English
quickguide-einnovator-3-rabbitmq
MuleSoft Surat Meetup#55 - Unleash the power of Anypoint MQ
Rabbitmq basics
Messaging for Modern Applications
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
Multi-platform Enterprise Messaging with RabbitMQ
Pika driver
Ad

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Modernizing your data center with Dell and AMD
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Digital-Transformation-Roadmap-for-Companies.pptx
Modernizing your data center with Dell and AMD
20250228 LYD VKU AI Blended-Learning.pptx
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Understanding_Digital_Forensics_Presentation.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Machine learning based COVID-19 study performance prediction
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.

RabbitMQ and AMQP Model

  • 1. 1
  • 2. 2 Agenda • What is & Why RabbitMQ • RabbitMQ & AMQP • Demo • Application Architectures • Q&A
  • 4. What & Why 4 • Open source, lightweight message broker • Flexible configurations to control message delivering behavior • Third-party plugin support • Integrated Security • Platform neutral AMQP implementation with many programming language support as client Publish C
  • 5. RabbitMQ & AMQP 5 • RabbitMQ implements the AMQP protocol • We have to speak AMQP to work with RabbitMQ • Like OOP, AMQP has classes and methods - AMQP commands • Knowing AMQP will be a definite help when working client libraries • AMQP commands marshal into frames App Client Image Ref: https://www.brianstorti.com/speaking-rabbit-amqps-frame-structure/
  • 9. Connection vs Channel 9 • Keep one Connection to RabbitMQ • Create Channel to transmit information • A single AMQP connection can have multiple channels Client
  • 10. Declaring an Exchange 10 • Exchange is responsible for message routing • Routing algorithm will be based on the exchange type • Exchanges are created using the Exchange.Declare command, Once the command has been sent and RabbitMQ has created the exchange, an Exchange.DeclareOk method frame is sent in response, if error Channel.Close • PHP - $channel->exchange_declare() • JAVA - channel.exchangeDeclare() • JavaScript - ch.assertExchange()
  • 11. Declaring a Queue 11 • Queues used to store actual data • Created using Queue.Declare command, returning Queue.DeclareOK. if there are any errors close the channel. • Params: queueName, durable, exclusive, autoDelete • Java - channel.queueDeclare() • C# - channel.QueueDeclare() • PHP - $channel->queue_declare()
  • 12. Bind a Queue 12 • Bind using Queue.Bind command and return Queue.BindOk • Bind a Queue to an Exchange • Params: queueName, exchange,routingKey • Java - channel.queueBind() • Python - channel.queue_bind
  • 13. AMQP Model in nutshell 13 • Exchange.Declare • Queue.Declare • Queue.Bind
  • 14. Exchange types 14 • Direct exchange - Delivers messages to queues based on the message routing key. Default exchange is direct exchange with no name (Empty string) • Fanout exchange - Routes messages to all the queues that are bound to it and the routing key is ignored. • Topic exchange - Route messages to one or many queues based on pattern matching between a message routing key and binding • Headers exchange - Uses message headers and ignore routing keys
  • 15. Reading a Queue & Acknowledgement 15 • Use Basic.Consume command, this is a push modal • Basic.Ack used to confirm or can use auto acknowledgement when Binding • When no_ack set to true, RabbitMQ will send messages continuously until the consumer sends a Basic.Cancel command or the consumer is disconnected. • If the no_ack flag is set to false, a consumer must acknowledge each message that it receives by sending a Basic.Ack Client Consume Ack
  • 16. Let’s start the demo 16 • Get start with RabbitMQ • Run RabbitMQ as a docker instance • Use default exchange to publish & consume • Demo - face detection application • RabbitMQ in AWS EC2 – Remote • Image uploader in AWS • Image processor in local machine docker run -d --hostname my-rabbit --name some-rabbit -p 5672:5672 -p 8282:15672 rabbitmq:3-management
  • 18. Demo.. 18 Web App FaceDetection p-Img-request p-Img-response FD-R-Q Key: FD-R-Q C Key: detect-faces FaceDetection DesktopApp (OpenCV) I-W-PID Key: detect-faces C Exchanges Queues CQueueConsumber
  • 19. Architectural choices 19 • Tightly coupled application • Decouple DB updates Application DB Application DB
  • 20. Architectural choices.. 20 • Add new features Application C1 DB C2 Another System
  • 23. Architectural choices 23 • Loosely coupled components • Realtime and Reactive capabilities • Improve scalability of applications • Easy and seamless adding of new features • Replication of data, events or even full application
  • 24. Q & A 24 • Thank you!!

Editor's Notes

  • #2: I am Rajitha from Gapstars and I am working for Conxillium RabbitMQ to sync data between our application Desktop other in Mutitenant Cloud native application Seamless user experience between two applications
  • #3: 1st What is and & Why RabbitMQ 2nd RabbitMQ & AMQP AMQP Protocol How to speak AMQ Protocol AMQP Model Exchange Queues Binding Also Connection Channel After 2nd section, I can answer questions if you have Demo – Coding and Face detection application in Cloud –AWS and Face detection in Local machine
  • #4: Running as a Docker instance This is Web Console RabbiMQs default post is 5672
  • #5: Open Source Mozilla Public License Light weight (40 MB) memory to operate Easy to get start and deploy Flexible configuration Message Routing algorithm Persist messages, Queue Failour handling Plugin to support multiprotocols (AMQP, STOMP Text base, JMS) SSL support for Connection, Authentication Actually RabbitMQ is impl of AMQP – Advance message queueing protocol Like HTTP language independent That is why RabbitMQ and AMQP is going together
  • #8: This is the internal protocol level communication 5 Frame types (Prptocol Header, Method Frame, Content Header Frame, Body Frame, Heart Beat Frame) The GOOD thing is…. We do not have to warry about these internal structures Client Libs do this for us We have to know AMQP Model.. That’s all
  • #9: Exchange -> that routes messages to queues, Different type of exchanges.. (Like post office, post exchange, Some sorted through address, some through POST BOX Number.. ) Queue—A data structure on disk or in memory FIFO queue Binding—Bind exchange with a queue
  • #16: Now you know Exchange Queue Binding And how to consume a message Lets move on to the demo
  • #18: Image Processor on local with OpenCV And it is connected to RabbitMQ App user will upload and img for process App will send it to RabbitMQ to process.. Who ever connetec to RabbitMQ will process it and send data back
  • #19: 1. two exchanges will be declared when application starting up 2.Create a queue for the Worker 3. Bind the Queue with “request” exchange with “detect-faces” key 4. Start to consume that queue 5. Web App 6. After user upload an Image 7. Create a queue with “face-detection-response-queue” 8. Bind it with “response” Exchange with routing key as QueueName it self 9. Then it will get ready to consume its own created queue 10. Also send the message to “request” Exchange with routing key “detect-faces” and set the reply to as it is own queue
  • #25: Exchange -> that routes messages to queues, Different type of exchanges.. (Like post office, post exchange, Some sorted through address, some through POST BOX Number.. ) Queue—A data structure on disk or in memory FIFO queue Binding—Bind exchange with a queue
  • #26: Exchange -> that routes messages to queues, Different type of exchanges.. (Like post office, post exchange, Some sorted through address, some through POST BOX Number.. ) Queue—A data structure on disk or in memory FIFO queue Binding—Bind exchange with a queue