SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Messaging Standards and Systems
AMQP & RabbitMQ
Gavin M. Roy
VP of Architecture
AWeber Communications
Twitter: @Crad
All Things Open
October 22, 2014
About Me
VP of Architecture

AWeber Communications

Blame me for pika, rabbitpy,
pamqp, and a handful of
RabbitMQ plugins

Blog: https://gavinroy.com 

Github: https://github.com/gmr

Book: http://manning.com/roy
Advanced Message Queueing Protocol
❖ Open Standard
❖ Platform and Vendor Neutral
❖ Multiple Versions
AMQP Timeline
2003
2005
2006
2008
2011
Initial Specification
Working Group formed
AMQP 0-8
AMQP 0-9-1
OASIS
AMQP 1.0
AMQP Working Group
❖ JPMorgan Chase
❖ Cisco Systems
❖ IONA Technologies
❖ iMatrix
❖ RedHat
❖ TWIST
❖ Bank of America
❖ Barclays
❖ Credit Suisse
❖ Deutsche Börse Systems
❖ Goldman Sachs
❖ HCL Technologies
❖ Progress Software
❖ IIT Software
❖ INETCO Systems Ltd.
❖ Informatica Corporation
❖ Microsoft Corporation
❖ my-Channels
❖ Novell
❖ Solace Systems
❖ Tervala, Inc.
❖ VMWare
❖ WSO2
Competing AMQP Standards
≠
0-8
&
0-9-1
1.0
AMQP 0-9-1
❖ Currently has wider support than AMQP 1.0
❖ Multiple Broker Implementations: 

RabbitMQ, Apache Qpid, and SwiftMQ to name a few
❖ Specifies a Model and Protocol
Native AMQP 0-8/0-9-1 Clients
C
Clojure
Cobol
Common Lisp
Delphi
Erlang
Go
Groovy
Haskell
Java
JavaScript
.NET
OCaml
Perl
PHP
Python
Ruby
Scala
❖ Exchange

Receives and route messages
❖ Message Queue

Stores messages until they can be

consumed
❖ Binding

Defines the relationship between an Exchange and Queue and provides
routing criteria
Advanced Message Queueing Model
X
Exchange
Binding
Message Queue
Routing Keys
❖ Provided when publishing a message
❖ Compared against binding keys by exchanges
❖ Ideally provide context to the message:
❖ Connote the type of the message
❖ Categorize the content in the message
❖ Specify the type of consumer that should receive it
Advanced Message Queueing Protocol
❖ Compact, binary frame format wire protocol
❖ Bi-directional RPC
❖ Commands consist of Classes and Methods:
❖ Example Request:



Queue.Declare(name=“foo”)
❖ Response:



Queue.DeclareOk(messages=0, consumers=0)
Common AMQP Terms
❖ Broker

A server that implements AMQP
❖ Producer or Publisher

A client application that sends messages to a broker
❖ Consumer

A client application that reads messages from a queue
Publishers and Consumers
CP
Multiple Publishers
CP
P
P
Multiple Consumers
C
C
C
P
AMQP Messages
❖ Comprised of 3 or more frames:
❖ Method Frame

Basic.Publish, Basic.Deliver, etc
❖ Content Header with body size & message properties 

timestamp, message-id, app-id, etc
❖ n Body Frames with the opaque message payload
AMQP 0-9-1 Issues & Gotchas
❖ Ambiguous
❖ Authentication
❖ Asynchronous
❖ Connection Negotiation
❖ Exceptions
!
RabbitMQ
❖ Open Source (MPL)
❖ Written in Erlang/OTP
❖ Developed/Maintained by Pivotal
❖ Multi-Protocol

AMQP 0-9-1 & 1.0, MQTT, STOMP, XMPP,
HTTP, Web-STOMP & More
❖ Roots in AMQP 0-8/0-9-1
Who Uses It?
Agora Games
Chef
Google AdMob
Instagram
MeetMe
Mercado Libre
Mozilla
NASA
New York Times
National Science Foundation
Openstack
Rapportive
Reddit
Soundcloud
(and many more)
Why Use RabbitMQ?
❖ Create loosely-coupled applications
❖ Communicate across applications or platforms
❖ Tap into pre-existing message flows for new purposes
❖ Scale-out clustering for growth, throughput, and HA
❖ Federation for WAN latencies and network partitions
❖ Extensible plugin-in architecture
RabbitMQ Extensions to AMQP
Authentication Failure
Exchange to Exchange Bindings
Delivery Confirmations
Basic.Nack
Consumer cancellations
Consumer priorities
Dead Letter Exchanges
Alternate Exchanges
Connection blocking
Message CC & BCC Routing
Queue Length Limits
Per Queue Message TTL
Per Message TTL
Queue TTL
Message User ID Validation
Auto-delete exchanges
RabbitMQ Clustering
❖ LAN Only
❖ Adds highly-available queues
❖ Is cohesive, publish and consume
from any node
❖ Leverages native Erlang clustering
and communication
❖ Has multiple strategies for dealing
with network partitions
❖ Manually configured via
configuration or command line*
RabbitMQ Plugins
auth-backend-amqp

Use AMQP to respond to RabbitMQ
auth requests
auth-backend-http

Use a custom web service to provide
authentication
autocluster-consul

Automatically create clusters using
Consul
influxdb-storage-exchange

Store JSON messages as events in
InfluxDB
presence-exchange

Publishes messages upon binding
changes
rabbitmq-toke

Tokyo Cabinet backing store for queue
messages
rabbitmq-top

Top like view of RabbitMQ processes
in the management UI
sharding

Scale out RabbitMQ with automatic
queue sharding
(and many more)
Message Routing
Built-In Exchange Types
❖ Direct

String matching on the routing key
❖ Fanout

No routing key, messages delivered to all bound queues
❖ Topic

Pattern matching in the routing key
❖ Headers

No routing key, value matching in the headers property
Topic Exchange Binding Keys
Routing Key: namespace.delimited.keys
#

Receive all messages
namespace.#

Receive all messages in namespace
namespace.delimited.*

Receive all namespace.delimited messages
namespace.*.keys

Receive all namespace messages ending with keys
Exchange to Exchange Binding
X
X
X
Queue
Queue
Queue
Queue
Queue
Queue
Messages published into a topic exchange are
routed to two other exchanges and a queue
Messages published into the consistent-hashing
exchange are distributed amongst three queues
Messages published into a direct
exchange routed to two queues
P
Alternate Exchanges
P X
Unroutable
Messages
X
Unroutable messages are
sent to an alternate exchange
Dead Letter Exchanges
P X
Reject Queue
Queue C
X
Consumer rejects the
message without requeue
Dead-Letter Exchange
routes the message
Exchange Plugins
Consistent Hashing

Distribute messages via hashed value
of routing key
Event

Publishes messages on AMQP events
such as queue creation
Random

Distribute messages across all bound
queues randomly
PostgreSQL LISTEN

Subscribes to and publishes
PostgreSQL notifications
Recent History

Sends the last n messages to any
newly bound queue
Reverse Topic

Allows for routing patterns at publish
time and not via binding
Riak Storage

Stores messages published through
the exchange into Riak
Script Exchange

Calls out to external scripts for
message routing
Performance Considerations
Publishing Performance Scale
Persisted
M
essages
Transactions
H
A
Q
ueues
Publisherconfirm
s
N
o
guarantees
N
otification
on
failureAlternate
exchanges
H
A
Q
ueues
w
/Transactions
Persisted Messages IO Model
Disk
Queue
Message Queue
Queue
Messages with delivery-mode 2 sent
into RabbitMQ are persisted to disk
Pointers to the message are placed
in the queue data structures
When the message is no longer in
a queue, it is removed from disk
HA Queues & Performance
Queue
Queue
Queue
P
RabbitMQ Cluster
A publisher sends to any
node in a RabbitMQ cluster
The RabbitMQ servers in the
cluster synchronize the state
of the message in the queue
The message that was published is put in
the queue and is stored on each server
Consumer Performance Scale
G
etting
M
essages
C
onsum
ing
and
using
Transactions
C
onsum
e
w
ith
Acknow
ledgem
ents
C
onsum
ing
w
ith
"N
o
Ack
M
ode"enabled
C
onsum
ing
w
ith
Acknow
ledgem
ents
and
Q
oS
>
1
Operational Concerns
Trending & Monitoring
❖ RabbitMQ Management Plugin provides internal stats
❖ Queue depths, connection counts, throughput, memory
usage, etc
❖ Monitor with common tools such as Nagios or Sensu to
services such as Boundary and NewRelic
❖ Stream based monitoring with Riemann for anomaly
detection
Thoughts on Configuration
❖ Use configuration management!
❖ Even for exchanges, queues, and bindings if possible
❖ Helpful for disaster recovery
❖ Use RabbitMQ’s Policies when possible
❖ Exchanges and queues are immutable
❖ Deleting and redeclaring for changes can be
disruptive
Sample Usage Patterns
Evolve Tightly-Coupled Applications
Application DB
Decoupling Database Writes
Application C DB
Listen for Database Notifications
X Queue
Multi-Purposed Messages
C
C
C
P
Queue
DB
Cloud
GraphiteQueue
Queue
X
RPC
C / PC / P
P / C
C / PResponse Queue
X
X
Worker
Queue
Front-end web app
receives a request
Internet
App publishes RPC request
One of the subscribed
worker consumers receives
the RPC request
After processing the request,
the worker publishes the replyApp receives the reply
from the response queue
App replies to client
Delayed Messages
WARNING: This pattern is a hack and can cause undesirable situations should the wait queue overwhelm the system!
P X
X
Wait Queue
Ready Queue C
The wait queue is declared with a
message TTL and a dead-letter exchangeMessages that will be delivered
later are routed to a wait queue
When a message times out due to
the TTL, it is published to the DLX
The internally re-published message is
routed to the queue with active consumers
Questions?
manning.com
Discount code
ato2014cftw

Más contenido relacionado

La actualidad más candente

NServiceBus introduction
NServiceBus introductionNServiceBus introduction
NServiceBus introduction
Boris Tveritnev
 

La actualidad más candente (20)

RabbitMq
RabbitMqRabbitMq
RabbitMq
 
RabbitMQ
RabbitMQRabbitMQ
RabbitMQ
 
Easy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQPEasy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQP
 
RabbitMQ.ppt
RabbitMQ.pptRabbitMQ.ppt
RabbitMQ.ppt
 
RabbitMQ interview Questions and Answers
RabbitMQ interview Questions and AnswersRabbitMQ interview Questions and Answers
RabbitMQ interview Questions and Answers
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
Spring integration
Spring integrationSpring integration
Spring integration
 
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersIBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
 
RabbitMQ
RabbitMQ RabbitMQ
RabbitMQ
 
RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client library
 
NServiceBus
NServiceBusNServiceBus
NServiceBus
 
Message Broker System and RabbitMQ
Message Broker System and RabbitMQMessage Broker System and RabbitMQ
Message Broker System and RabbitMQ
 
NServiceBus introduction
NServiceBus introductionNServiceBus introduction
NServiceBus introduction
 
Kafka on Pulsar
Kafka on Pulsar Kafka on Pulsar
Kafka on Pulsar
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging Service
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
RabbitMQ Operations
RabbitMQ OperationsRabbitMQ Operations
RabbitMQ Operations
 
Message Oriented Middleware (MOM)
Message Oriented Middleware (MOM)Message Oriented Middleware (MOM)
Message Oriented Middleware (MOM)
 
Getting Started with Consul
Getting Started with ConsulGetting Started with Consul
Getting Started with Consul
 
NGINX, Istio, and the Move to Microservices and Service Mesh
NGINX, Istio, and the Move to Microservices and Service MeshNGINX, Istio, and the Move to Microservices and Service Mesh
NGINX, Istio, and the Move to Microservices and Service Mesh
 

Destacado

The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP
Eberhard Wolff
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
James Carr
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example Applications
Houcheng Lin
 

Destacado (12)

The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal Architecture
 
Performance na Web - GDG DevFest SP 2014
Performance na Web - GDG DevFest SP 2014Performance na Web - GDG DevFest SP 2014
Performance na Web - GDG DevFest SP 2014
 
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
 
RabbitMQ Plugins Talk
RabbitMQ Plugins TalkRabbitMQ Plugins Talk
RabbitMQ Plugins Talk
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmq
 
Improvements in RabbitMQ
Improvements in RabbitMQImprovements in RabbitMQ
Improvements in RabbitMQ
 
Rabbitmq, amqp Intro - Messaging Patterns
Rabbitmq, amqp Intro - Messaging PatternsRabbitmq, amqp Intro - Messaging Patterns
Rabbitmq, amqp Intro - Messaging Patterns
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
 
LVIV IT Arena - SmartHome using low cost components
LVIV IT Arena - SmartHome using low cost componentsLVIV IT Arena - SmartHome using low cost components
LVIV IT Arena - SmartHome using low cost components
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
 
RabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example ApplicationsRabbitMQ Model and Some Example Applications
RabbitMQ Model and Some Example Applications
 

Similar a Messaging Standards and Systems - AMQP & RabbitMQ

Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
Ortus Solutions, Corp
 
f2f-overview1-presentation about rabbitmq and middleware
f2f-overview1-presentation about rabbitmq and middlewaref2f-overview1-presentation about rabbitmq and middleware
f2f-overview1-presentation about rabbitmq and middleware
ndonikristi98
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in action
dejanb
 

Similar a Messaging Standards and Systems - AMQP & RabbitMQ (20)

Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 
Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
 
Messaging-as-a-Service Rivieradev 2017
Messaging-as-a-Service Rivieradev 2017Messaging-as-a-Service Rivieradev 2017
Messaging-as-a-Service Rivieradev 2017
 
AMQP with RabbitMQ
AMQP with RabbitMQAMQP with RabbitMQ
AMQP with RabbitMQ
 
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
Beyond REST and RPC: Asynchronous Eventing and Messaging PatternsBeyond REST and RPC: Asynchronous Eventing and Messaging Patterns
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
 
Rabbit MQ
Rabbit MQRabbit MQ
Rabbit MQ
 
ITB2019 Multi-language / multi-OS communication using RabbitMQ - Wil de Bruin
ITB2019 Multi-language / multi-OS communication using RabbitMQ - Wil de BruinITB2019 Multi-language / multi-OS communication using RabbitMQ - Wil de Bruin
ITB2019 Multi-language / multi-OS communication using RabbitMQ - Wil de Bruin
 
Multi-language/multi-OS communication using RabbitMQ
Multi-language/multi-OS communication using RabbitMQMulti-language/multi-OS communication using RabbitMQ
Multi-language/multi-OS communication using RabbitMQ
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introduction
 
Message Broker implementation in Kubernetes
Message Broker implementation in KubernetesMessage Broker implementation in Kubernetes
Message Broker implementation in Kubernetes
 
Multi-platform Enterprise Messaging with RabbitMQ
Multi-platform Enterprise Messaging with RabbitMQMulti-platform Enterprise Messaging with RabbitMQ
Multi-platform Enterprise Messaging with RabbitMQ
 
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure FunctionsMessaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
 
An Introduction to the Message Queuing Technology & IBM WebSphere MQ
An Introduction to the Message Queuing Technology & IBM WebSphere MQAn Introduction to the Message Queuing Technology & IBM WebSphere MQ
An Introduction to the Message Queuing Technology & IBM WebSphere MQ
 
Velocity Conference '13: Asynchronous messaging for performance optimization,...
Velocity Conference '13: Asynchronous messaging for performance optimization,...Velocity Conference '13: Asynchronous messaging for performance optimization,...
Velocity Conference '13: Asynchronous messaging for performance optimization,...
 
f2f-overview12.ppt
f2f-overview12.pptf2f-overview12.ppt
f2f-overview12.ppt
 
f2f-overview1-presentation about rabbitmq and middleware
f2f-overview1-presentation about rabbitmq and middlewaref2f-overview1-presentation about rabbitmq and middleware
f2f-overview1-presentation about rabbitmq and middleware
 
Orchestration Patterns for Microservices with Messaging by RabbitMQ
Orchestration Patterns for Microservices with Messaging by RabbitMQOrchestration Patterns for Microservices with Messaging by RabbitMQ
Orchestration Patterns for Microservices with Messaging by RabbitMQ
 
Captial One: Why Stream Data as Part of Data Transformation?
Captial One: Why Stream Data as Part of Data Transformation?Captial One: Why Stream Data as Part of Data Transformation?
Captial One: Why Stream Data as Part of Data Transformation?
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in action
 
Open Source Bristol 30 March 2022
Open Source Bristol 30 March 2022Open Source Bristol 30 March 2022
Open Source Bristol 30 March 2022
 

Más de All Things Open

Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
All Things Open
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
All Things Open
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
All Things Open
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
All Things Open
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open Source
All Things Open
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in control
All Things Open
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
All Things Open
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
All Things Open
 

Más de All Things Open (20)

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of Observability
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best Practices
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil Nash
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScript
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and Success
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssembly
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in Haystacks
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit Intercept
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship Program
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open Source
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache Beam
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in control
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Messaging Standards and Systems - AMQP & RabbitMQ

  • 1. Messaging Standards and Systems AMQP & RabbitMQ Gavin M. Roy VP of Architecture AWeber Communications Twitter: @Crad All Things Open October 22, 2014
  • 2. About Me VP of Architecture
 AWeber Communications Blame me for pika, rabbitpy, pamqp, and a handful of RabbitMQ plugins Blog: https://gavinroy.com Github: https://github.com/gmr Book: http://manning.com/roy
  • 3. Advanced Message Queueing Protocol ❖ Open Standard ❖ Platform and Vendor Neutral ❖ Multiple Versions
  • 4. AMQP Timeline 2003 2005 2006 2008 2011 Initial Specification Working Group formed AMQP 0-8 AMQP 0-9-1 OASIS AMQP 1.0
  • 5. AMQP Working Group ❖ JPMorgan Chase ❖ Cisco Systems ❖ IONA Technologies ❖ iMatrix ❖ RedHat ❖ TWIST ❖ Bank of America ❖ Barclays ❖ Credit Suisse ❖ Deutsche Börse Systems ❖ Goldman Sachs ❖ HCL Technologies ❖ Progress Software ❖ IIT Software ❖ INETCO Systems Ltd. ❖ Informatica Corporation ❖ Microsoft Corporation ❖ my-Channels ❖ Novell ❖ Solace Systems ❖ Tervala, Inc. ❖ VMWare ❖ WSO2
  • 7. AMQP 0-9-1 ❖ Currently has wider support than AMQP 1.0 ❖ Multiple Broker Implementations: 
 RabbitMQ, Apache Qpid, and SwiftMQ to name a few ❖ Specifies a Model and Protocol
  • 8. Native AMQP 0-8/0-9-1 Clients C Clojure Cobol Common Lisp Delphi Erlang Go Groovy Haskell Java JavaScript .NET OCaml Perl PHP Python Ruby Scala
  • 9. ❖ Exchange
 Receives and route messages ❖ Message Queue
 Stores messages until they can be
 consumed ❖ Binding
 Defines the relationship between an Exchange and Queue and provides routing criteria Advanced Message Queueing Model X Exchange Binding Message Queue
  • 10. Routing Keys ❖ Provided when publishing a message ❖ Compared against binding keys by exchanges ❖ Ideally provide context to the message: ❖ Connote the type of the message ❖ Categorize the content in the message ❖ Specify the type of consumer that should receive it
  • 11. Advanced Message Queueing Protocol ❖ Compact, binary frame format wire protocol ❖ Bi-directional RPC ❖ Commands consist of Classes and Methods: ❖ Example Request:
 
 Queue.Declare(name=“foo”) ❖ Response:
 
 Queue.DeclareOk(messages=0, consumers=0)
  • 12. Common AMQP Terms ❖ Broker
 A server that implements AMQP ❖ Producer or Publisher
 A client application that sends messages to a broker ❖ Consumer
 A client application that reads messages from a queue
  • 16. AMQP Messages ❖ Comprised of 3 or more frames: ❖ Method Frame
 Basic.Publish, Basic.Deliver, etc ❖ Content Header with body size & message properties 
 timestamp, message-id, app-id, etc ❖ n Body Frames with the opaque message payload
  • 17. AMQP 0-9-1 Issues & Gotchas ❖ Ambiguous ❖ Authentication ❖ Asynchronous ❖ Connection Negotiation ❖ Exceptions !
  • 18. RabbitMQ ❖ Open Source (MPL) ❖ Written in Erlang/OTP ❖ Developed/Maintained by Pivotal ❖ Multi-Protocol
 AMQP 0-9-1 & 1.0, MQTT, STOMP, XMPP, HTTP, Web-STOMP & More ❖ Roots in AMQP 0-8/0-9-1
  • 19. Who Uses It? Agora Games Chef Google AdMob Instagram MeetMe Mercado Libre Mozilla NASA New York Times National Science Foundation Openstack Rapportive Reddit Soundcloud (and many more)
  • 20. Why Use RabbitMQ? ❖ Create loosely-coupled applications ❖ Communicate across applications or platforms ❖ Tap into pre-existing message flows for new purposes ❖ Scale-out clustering for growth, throughput, and HA ❖ Federation for WAN latencies and network partitions ❖ Extensible plugin-in architecture
  • 21. RabbitMQ Extensions to AMQP Authentication Failure Exchange to Exchange Bindings Delivery Confirmations Basic.Nack Consumer cancellations Consumer priorities Dead Letter Exchanges Alternate Exchanges Connection blocking Message CC & BCC Routing Queue Length Limits Per Queue Message TTL Per Message TTL Queue TTL Message User ID Validation Auto-delete exchanges
  • 22. RabbitMQ Clustering ❖ LAN Only ❖ Adds highly-available queues ❖ Is cohesive, publish and consume from any node ❖ Leverages native Erlang clustering and communication ❖ Has multiple strategies for dealing with network partitions ❖ Manually configured via configuration or command line*
  • 23. RabbitMQ Plugins auth-backend-amqp
 Use AMQP to respond to RabbitMQ auth requests auth-backend-http
 Use a custom web service to provide authentication autocluster-consul
 Automatically create clusters using Consul influxdb-storage-exchange
 Store JSON messages as events in InfluxDB presence-exchange
 Publishes messages upon binding changes rabbitmq-toke
 Tokyo Cabinet backing store for queue messages rabbitmq-top
 Top like view of RabbitMQ processes in the management UI sharding
 Scale out RabbitMQ with automatic queue sharding (and many more)
  • 25. Built-In Exchange Types ❖ Direct
 String matching on the routing key ❖ Fanout
 No routing key, messages delivered to all bound queues ❖ Topic
 Pattern matching in the routing key ❖ Headers
 No routing key, value matching in the headers property
  • 26. Topic Exchange Binding Keys Routing Key: namespace.delimited.keys #
 Receive all messages namespace.#
 Receive all messages in namespace namespace.delimited.*
 Receive all namespace.delimited messages namespace.*.keys
 Receive all namespace messages ending with keys
  • 27. Exchange to Exchange Binding X X X Queue Queue Queue Queue Queue Queue Messages published into a topic exchange are routed to two other exchanges and a queue Messages published into the consistent-hashing exchange are distributed amongst three queues Messages published into a direct exchange routed to two queues P
  • 28. Alternate Exchanges P X Unroutable Messages X Unroutable messages are sent to an alternate exchange
  • 29. Dead Letter Exchanges P X Reject Queue Queue C X Consumer rejects the message without requeue Dead-Letter Exchange routes the message
  • 30. Exchange Plugins Consistent Hashing
 Distribute messages via hashed value of routing key Event
 Publishes messages on AMQP events such as queue creation Random
 Distribute messages across all bound queues randomly PostgreSQL LISTEN
 Subscribes to and publishes PostgreSQL notifications Recent History
 Sends the last n messages to any newly bound queue Reverse Topic
 Allows for routing patterns at publish time and not via binding Riak Storage
 Stores messages published through the exchange into Riak Script Exchange
 Calls out to external scripts for message routing
  • 33. Persisted Messages IO Model Disk Queue Message Queue Queue Messages with delivery-mode 2 sent into RabbitMQ are persisted to disk Pointers to the message are placed in the queue data structures When the message is no longer in a queue, it is removed from disk
  • 34. HA Queues & Performance Queue Queue Queue P RabbitMQ Cluster A publisher sends to any node in a RabbitMQ cluster The RabbitMQ servers in the cluster synchronize the state of the message in the queue The message that was published is put in the queue and is stored on each server
  • 37. Trending & Monitoring ❖ RabbitMQ Management Plugin provides internal stats ❖ Queue depths, connection counts, throughput, memory usage, etc ❖ Monitor with common tools such as Nagios or Sensu to services such as Boundary and NewRelic ❖ Stream based monitoring with Riemann for anomaly detection
  • 38. Thoughts on Configuration ❖ Use configuration management! ❖ Even for exchanges, queues, and bindings if possible ❖ Helpful for disaster recovery ❖ Use RabbitMQ’s Policies when possible ❖ Exchanges and queues are immutable ❖ Deleting and redeclaring for changes can be disruptive
  • 42. Listen for Database Notifications X Queue
  • 44. RPC C / PC / P P / C C / PResponse Queue X X Worker Queue Front-end web app receives a request Internet App publishes RPC request One of the subscribed worker consumers receives the RPC request After processing the request, the worker publishes the replyApp receives the reply from the response queue App replies to client
  • 45. Delayed Messages WARNING: This pattern is a hack and can cause undesirable situations should the wait queue overwhelm the system! P X X Wait Queue Ready Queue C The wait queue is declared with a message TTL and a dead-letter exchangeMessages that will be delivered later are routed to a wait queue When a message times out due to the TTL, it is published to the DLX The internally re-published message is routed to the queue with active consumers