SlideShare a Scribd company logo
Taming The Rabbit
                            Writing RabbitMQ Plugins



                            Alvaro Videla - VMware




Wednesday, October 24, 12
About Me
                    •       Developer Advocate for Cloud Foundry

                    •       Blog: http://videlalvaro.github.com/

                    •       Twitter: @old_sound




Wednesday, October 24, 12
About Me
                    •       Developer Advocate for Cloud Foundry

                    •       Blog: http://videlalvaro.github.com/

                    •       Twitter: @old_sound

                    •       I created gifsockets™




Wednesday, October 24, 12
About Me
                            Co-authored

               RabbitMQ in Action
              http://bit.ly/rabbitmq




Wednesday, October 24, 12
RabbitMQ

Wednesday, October 24, 12
RabbitMQ

                    • Enterprise Messaging System
                    • Open Source MPL
                    • Written in Erlang/OTP
                    • Messaging via AMQP
                    • Acquired by Spring Source (VMware)

Wednesday, October 24, 12
Features

                    • Reliable and High Scalable
                    • Easy To install
                    • Easy To Cluster
                    • Runs on: Windows, Solaris, Linux, OSX
                    • AMQP 0.8 - 0.9.1

Wednesday, October 24, 12
Wednesday, October 24, 12
Extensible
                    • Plugin System
                    • Official Plugins
                    • Community Plugins



Wednesday, October 24, 12
Extensible
                    • Plugin System
                    • Official Plugins
                    • Community Plugins
                    • Plugins must be written in Erlang


Wednesday, October 24, 12
Wednesday, October 24, 12
What can you do with
                          plugins?


Wednesday, October 24, 12
Add new
                            Protocols
Wednesday, October 24, 12
STOMP
Wednesday, October 24, 12
STOMP

                            COMMAND
                            header1:value1
                            header2:value2

                            Body^@



Wednesday, October 24, 12
STOMP

                            CONNECT
                            accept-version:1.1
                            host:stomp.github.org

                            ^@



Wednesday, October 24, 12
STOMP

                            CONNECTED
                            version:1.1

                            ^@




Wednesday, October 24, 12
Websockets
                                +
                             STOMP
                                =
                            WebSTOMP
Wednesday, October 24, 12
Add Authentication
                               Mechanisms


Wednesday, October 24, 12
LDAP
Wednesday, October 24, 12
SSL
Wednesday, October 24, 12
Add your own Message
                         Store


Wednesday, October 24, 12
Must Read
         http://www.rabbitmq.com/blog/2011/01/20/rabbitmq-
                  backing-stores-databases-and-disks/




Wednesday, October 24, 12
Wrap Erlang apps
                             together with
                               RabbitMQ


Wednesday, October 24, 12
cowboy-wrapper



Wednesday, October 24, 12
ldap-wrapper



Wednesday, October 24, 12
webmachine-wrapper



Wednesday, October 24, 12
Add extra functionality
                      to the broker


Wednesday, October 24, 12
RabbitMQ
                     Management Plugin


Wednesday, October 24, 12
http://www.rabbitmq.com/img/management/overview.png
Wednesday, October 24, 12
RabbitMQ
                            Shovel Plugin


Wednesday, October 24, 12
Create your Own
                               Exchanges


Wednesday, October 24, 12
Why?

Wednesday, October 24, 12
Exchanges

Wednesday, October 24, 12
Message Flow




                  http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.0/html/Messaging_Tutorial/chap-Messaging_Tutorial-Initial_Concepts.html



Wednesday, October 24, 12
AMQP Model

                    • Exchanges
                    • Message Queues
                    • Bindings
                    • Rules for binding them

Wednesday, October 24, 12
Exchange Types

                    • Fanout
                    • Direct
                    • Topic


Wednesday, October 24, 12
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.0/html/Messaging_Tutorial/sect-Messaging_Tutorial-Initial_Concepts-
                                                                      Fanout_Exchange.html




Wednesday, October 24, 12
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.0/html/Messaging_Tutorial/sect-Messaging_Tutorial-Initial_Concepts-
                                                                       Direct_Exchange.html




Wednesday, October 24, 12
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.0/html/Messaging_Tutorial/sect-Messaging_Tutorial-Initial_Concepts-
                                                                       Topic_Exchange.html




Wednesday, October 24, 12
random-exchange



Wednesday, October 24, 12
consistent-hash-exchange




Wednesday, October 24, 12
riak-exchange




Wednesday, October 24, 12
rabbitmq-global-fanout-exchange




Wednesday, October 24, 12
recent-history-exchange




Wednesday, October 24, 12
recent-history-exchange
                                                                 user_x


                            Using the recent history exchange      New
                                                                   Msg
                            Last N messages


                                  Msg
                                                    New         Chat Room
                                                    Msg         Exchange
                                 Cache




                                Cached              New            New       New
                                 Msgs               Msg            Msg       Msg




                                                  user_a         user_b     user_c



                              new_user
                                                                http://manning.com/videla/
Wednesday, October 24, 12
Exchange Behaviours




Wednesday, October 24, 12
recent-history-exchange

                                             Caches up to
                                             20 messages
                            Recent History
                              Exchange
                                route/2
                                                Delivers
                             add_binding/3   cached msgs
                                             to new client
                               delete/3


                                                Drops
                                               cached
                                              messages


           http://manning.com/videla/
Wednesday, October 24, 12
Env Setup

      hg clone http://hg.rabbitmq.com/rabbitmq-public-umbrella
      cd rabbitmq-public-umbrella
      make co




Wednesday, October 24, 12
File Structure

                        |--   rabbitmq-public-umbrella
                        |     |-- myplugin-folder
                        |     |   | -- package.mk
                        |     |   | -- Makefile




Wednesday, October 24, 12
RabbitMQ Boot Steps

                https://github.com/videlalvaro/rabbit-internals/blob/master/rabbit_boot_process.md




Wednesday, October 24, 12
RabbitMQ Boot Steps




Wednesday, October 24, 12
RabbitMQ Boot Steps

           -rabbit_boot_step({recovery,
                              [{description,
                                        "exchange, queue and binding
                               recovery"},
                               {mfa,         {rabbit, recover, []}},
                               {requires,    empty_db_check},
                               {enables,     routing_ready}]}).




Wednesday, October 24, 12
RabbitMQ Boot Steps

               -rabbit_boot_step({msg_store_bitcask_index,
                      [{description,
                           "Bitcask Index for rabbit_msg_store"},
                       {mfa, {application, set_env,
                           [rabbit, msg_store_index_module, ?MODULE]}},
                       {enables, recovery}]}).




                            Modify Configuration at Startup


Wednesday, October 24, 12
Demo Code



Wednesday, October 24, 12
Managing Plugins



Wednesday, October 24, 12
rabbitmq-plugins

              $ rabbitmq-plugins list
              $ rabbitmq-plugins enable plugin_name
              $ rabbitmq-plugins disable plugin_name




           http://www.rabbitmq.com/man/rabbitmq-plugins.1.man.html

Wednesday, October 24, 12
ACHTUNG!
                    • Plugins Run in the same Erlang process




Wednesday, October 24, 12
ACHTUNG!
                    • Plugins Run in the same Erlang process
                    • They may crash your broker




Wednesday, October 24, 12
Have Fun
                                and
                            Experiment!

Wednesday, October 24, 12
Questions?



Wednesday, October 24, 12
Thanks!
                                     Álvaro Videla
                               http://twitter.com/old_sound
                               http://github.com/videlalvaro
                            http://www.slideshare.net/old_sound




Wednesday, October 24, 12

More Related Content

PDF
Rabbitmq Boot System
PDF
Fight with Metaspace OOM
PDF
Hazelcast
PDF
Toward 10,000 Containers on OpenStack
PDF
淺談 Java GC 原理、調教和 新發展
PDF
Distributed Lock Manager
PDF
How Prometheus Store the Data
PDF
Disruptor 2015-12-22 @ java.il
Rabbitmq Boot System
Fight with Metaspace OOM
Hazelcast
Toward 10,000 Containers on OpenStack
淺談 Java GC 原理、調教和 新發展
Distributed Lock Manager
How Prometheus Store the Data
Disruptor 2015-12-22 @ java.il

What's hot (20)

PPTX
Hazelcast
PDF
D’une infrastructure de virtualisation scripté à un cloud privé OpenNebula
PDF
Practicing Continuous Deployment
PDF
OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...
PDF
Go Programming Patterns
PDF
Connect2016 AD1387 Integrate with XPages and Java
PDF
Puppet Camp Dublin - 06/2012
PPTX
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
PDF
OpenNebula - OpenNebula and tips for CentOS 7
PDF
Open nebula froscon
PPT
The OSSCube MySQL High Availability Tutorial
PPTX
Cassandra Summit 2015: Real World DTCS For Operators
PDF
OpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and Architecture
PPTX
Understanding DSE Search by Matt Stump
PDF
OpenNebula 4.14 Hands-on Tutorial
PPTX
High Throughput Analytics with Cassandra & Azure
PDF
Non-blocking synchronization — what is it and why we (don't?) need it
PDF
TechDay - Cambridge 2016 - OpenNebula at Harvard Univerity
PDF
Distributed system coordination by zookeeper and introduction to kazoo python...
PDF
OpenNebula 5.4 Hands-on Tutorial
Hazelcast
D’une infrastructure de virtualisation scripté à un cloud privé OpenNebula
Practicing Continuous Deployment
OpenNebula Conf 2014 | OpenNebula and MooseFS for disaster recovery: real clo...
Go Programming Patterns
Connect2016 AD1387 Integrate with XPages and Java
Puppet Camp Dublin - 06/2012
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
OpenNebula - OpenNebula and tips for CentOS 7
Open nebula froscon
The OSSCube MySQL High Availability Tutorial
Cassandra Summit 2015: Real World DTCS For Operators
OpenNebulaConf 2013 - Hands-on Tutorial: 1. Introduction and Architecture
Understanding DSE Search by Matt Stump
OpenNebula 4.14 Hands-on Tutorial
High Throughput Analytics with Cassandra & Azure
Non-blocking synchronization — what is it and why we (don't?) need it
TechDay - Cambridge 2016 - OpenNebula at Harvard Univerity
Distributed system coordination by zookeeper and introduction to kazoo python...
OpenNebula 5.4 Hands-on Tutorial
Ad

Viewers also liked (14)

PDF
Integrating PostgreSql with RabbitMQ
PDF
BayLISA meetup: 8/16/12
PDF
Chef on SmartOS
PDF
Fi fo euc 2014
PDF
The Kitchen Cloud How To: Automating Joyent SmartMachines with Chef
PDF
SmartOS ZFS Architecture
PDF
PostgreSQL: meet your queue
PDF
OpenStack on SmartOS
PDF
Experiences porting KVM to SmartOS
PDF
SmartOS Primer
PDF
RabbitMQ Data Ingestion
PDF
CBSE XII Database Concepts And MySQL Presentation
PPTX
Steve Jobs Inspirational Quotes
PDF
Dissecting the rabbit: RabbitMQ Internal Architecture
Integrating PostgreSql with RabbitMQ
BayLISA meetup: 8/16/12
Chef on SmartOS
Fi fo euc 2014
The Kitchen Cloud How To: Automating Joyent SmartMachines with Chef
SmartOS ZFS Architecture
PostgreSQL: meet your queue
OpenStack on SmartOS
Experiences porting KVM to SmartOS
SmartOS Primer
RabbitMQ Data Ingestion
CBSE XII Database Concepts And MySQL Presentation
Steve Jobs Inspirational Quotes
Dissecting the rabbit: RabbitMQ Internal Architecture
Ad

Similar to Taming the rabbit (20)

PDF
RealTime Web with PocketIO
PDF
MongoDB Use Cases and Roadmap
PDF
Intro to NoSQL and MongoDB
PDF
OCaml Labs introduction at OCaml Consortium 2012
PDF
Apple Bonjour: Let's Talk!
PDF
Container Camp London (2016-09-09)
PPTX
Picking a message queue
PDF
Node jsworkshop
PDF
OpenStack in Action 4! Serge Frezefond - Database Clusters as a Service in O...
PDF
Berlin.JS Meetup
PDF
Cloud Foundry OpenTour Kiev Keynote
PDF
Dcamp ldn presentation
PDF
PuppetCamp SEA @ Blk 71 - Puppet: The Year That Was
PDF
PuppetCamp SEA @ Blk 71 - Puppet: The Year That Was
PDF
Corona SDK for 4Square Hackathon
PDF
HTML5 exam : checking answers
PDF
The Wonderful World of Symfony Components
PPTX
Cloudmesh feb-2016 2 (1)
PDF
Cloud Foundry Bootcamp
PPTX
It's in the cloud
RealTime Web with PocketIO
MongoDB Use Cases and Roadmap
Intro to NoSQL and MongoDB
OCaml Labs introduction at OCaml Consortium 2012
Apple Bonjour: Let's Talk!
Container Camp London (2016-09-09)
Picking a message queue
Node jsworkshop
OpenStack in Action 4! Serge Frezefond - Database Clusters as a Service in O...
Berlin.JS Meetup
Cloud Foundry OpenTour Kiev Keynote
Dcamp ldn presentation
PuppetCamp SEA @ Blk 71 - Puppet: The Year That Was
PuppetCamp SEA @ Blk 71 - Puppet: The Year That Was
Corona SDK for 4Square Hackathon
HTML5 exam : checking answers
The Wonderful World of Symfony Components
Cloudmesh feb-2016 2 (1)
Cloud Foundry Bootcamp
It's in the cloud

More from Alvaro Videla (20)

PDF
Improvements in RabbitMQ
PDF
Data Migration at Scale with RabbitMQ and Spring Integration
PDF
RabbitMQ Data Ingestion at Craft Conf
PDF
Scaling applications with RabbitMQ at SunshinePHP
PDF
Unit Test + Functional Programming = Love
PDF
Introduction to RabbitMQ | Meetup at Pivotal Labs
PDF
Writing testable code
PDF
RabbitMQ Hands On
PDF
Cloud Messaging With Cloud Foundry
PDF
PDF
Código Fácil De Testear
PDF
Desacoplando aplicaciones
PDF
Messaging patterns
PDF
Theres a rabbit on my symfony
PDF
Scaling Web Apps With RabbitMQ - Erlang Factory Lite
PDF
Integrating php withrabbitmq_zendcon
PDF
Scaling webappswithrabbitmq
PDF
Integrating RabbitMQ with PHP
PDF
Integrating Erlang with PHP
PDF
Interoperability With RabbitMq
Improvements in RabbitMQ
Data Migration at Scale with RabbitMQ and Spring Integration
RabbitMQ Data Ingestion at Craft Conf
Scaling applications with RabbitMQ at SunshinePHP
Unit Test + Functional Programming = Love
Introduction to RabbitMQ | Meetup at Pivotal Labs
Writing testable code
RabbitMQ Hands On
Cloud Messaging With Cloud Foundry
Código Fácil De Testear
Desacoplando aplicaciones
Messaging patterns
Theres a rabbit on my symfony
Scaling Web Apps With RabbitMQ - Erlang Factory Lite
Integrating php withrabbitmq_zendcon
Scaling webappswithrabbitmq
Integrating RabbitMQ with PHP
Integrating Erlang with PHP
Interoperability With RabbitMq

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Spectroscopy.pptx food analysis technology
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation_ Review paper, used for researhc scholars
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectroscopy.pptx food analysis technology
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

Taming the rabbit