SlideShare a Scribd company logo
1 of 35
RabbitMQ and Nanite
 Scalable Messaging
  Mathias Meyer, Peritor GmbH
The Problem

• A scalable backend to offload asynchronous
  tasks
 • Self-configuring
 • Self-healing
 • Self-assembling
• But not a lot of people have it
The Problem



• I’m still learning about the nitty-gritty details
Protocols
• JMS
• MQ
• XMPP
• SMTP (yep, for real)
• STOMP
• RestMS
• Wtf?
AMQP!
AMQP

• Open standard for messaging middleware
 • Vendor neutral
• Wire level protocol
• Mandates interoperatibility
 • Abundant number of libraries that speak it
AMQP


• Supports publish/subscribe and point-to-point
  messaging, among others
AMQP Components

• Broker
 • Combination of Exchange and a Queue
 • Exchange routes messages (stateless) based
   on patterns
 • Queue buffers messages (stateful)
 • Bound by Bindings
AMQP Components


• Consumer
• Producer
• Messages (duh!)
RabbitMQ
RabbitMQ
• Erlang-based, independent AMQP
 implementation
• Some 6k lines of code
• Apache Qpid (Java): 142k lines of code
• Also speaks STOMP, SMTP, XMPP and HTTP
• Message persistence uses a journal
• Wicked fast
RabbitMQ

• port install rabbitmq-server
• It just works™
• rabbitmqctl
• Can be clustered through Erlang’s distributed
  nodes
Nanite

• A self-assembling fabric of Ruby daemons
• Uses mappers, agents and actors
 • Mappers route message requests
 • Agents handle messages
 • Actors offer specific services bundled into
   agents
Nanite


• Messages can be simple pushes
• Or requests waiting for a response
Nanite
Agent




Agent               Mapper


         RabbitMQ
Agent               Mapper



Agent
Nanite Agents
Nanite Agents

class Reactor
 include Nanite::Actor
 expose :react

 def react(payload)
  "reacting to message with payload: #{payload}"
 end
end
Nanite


Nanite.request('/reactor/react', 'good acting is reacting') do |r|
 pr
end
Nanite

• Agents register themselves and advertise their
  services, constantly pinging the mappers
• Mappers remove timed-out agents
• Work distributed based on agent load
Nanite

• Agents can interoperate with each other
  during one single message processing
• Mapper state can (and should) be stored in
  redis
• Mappers live inside your application or
  standalone
Intermediate Messages
class Reactor
 include Nanite::Actor
 expose :react

 def react(payload)
  request("/worker/work", "kill all humans",
        :intermediate_handler => lambda {|res| puts res})
  # working, working...
  yield "I'm almost done"
  # cleanup the mess
  "done reacting to message with payload: #{payload}"
 end
end
Intermediate Messages
class Worker
 include Nanite::Actor
 expose :work

 def work(payload)
  Human.all.each do |human|
    human.destroy
    yield "Destroyed human #{human.name}"
  end
  "Killed all the humans"
 end
end
Nanite Internals


• Based on EventMachine and Ruby amqp library
  (also EventMachine-based)
• Everything runs in the EventMachine loop
Nanite Internals

• Uses a combination of the following queues to
  work
 • Registration queue
 • Heartbeat queue
 • Advertise queue
 • Agent queues
Nanite Internals

• Messages can be encrypted and signed
  between agents and mappers
• Sends marshaled Ruby (default),YAML or
  JSON
• The code internals are actually mind-boggling
Nanite Boos


• Poor documentation
• A not too great test suite
So how do we use it?




That really is a topic for another talk, isn’t it?
So how do we use it?




That really is a topic for another talk, isn’t it?
Resources
•   http://skillsmatter.com/podcast/erlang/alexis-richardson-
    introduction-to-rabbitmq

•   http://skillsmatter.com/podcast/erlang/rabbitmq-internal-
    architecture-tony-garnock-jones

•   http://brainspl.at/articles/2008/10/11/merbcamp-keynote-and-
    introducing-nanite

•   http://github.com/ezmobius/nanite

•   http://www.rabbitmq.com

•   http://www.amqp.org

•   http://www.slideshare.net/somic/introduction-to-amqp-messaging-
    with-rabbitmq

More Related Content

What's hot

The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message BrokerMartin Toshev
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQAll Things Open
 
An update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinAn update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinRabbitMQ Summit
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQPOSSCON
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQPvoluntas
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPEberhard Wolff
 
Distributed messaging with AMQP
Distributed messaging with AMQPDistributed messaging with AMQP
Distributed messaging with AMQPWee Keat Chin
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging QueuesNaukri.com
 
A walk-through of the design and architecture of RabbitMQ - Ayanda Dube
A walk-through of the design and architecture of RabbitMQ - Ayanda DubeA walk-through of the design and architecture of RabbitMQ - Ayanda Dube
A walk-through of the design and architecture of RabbitMQ - Ayanda DubeRabbitMQ Summit
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepthWee Keat Chin
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQKnoldus Inc.
 
What we've learned from running thousands of production RabbitMQ clusters - L...
What we've learned from running thousands of production RabbitMQ clusters - L...What we've learned from running thousands of production RabbitMQ clusters - L...
What we've learned from running thousands of production RabbitMQ clusters - L...RabbitMQ Summit
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmqSelasie Hanson
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQNahidul Kibria
 

What's hot (20)

RabbitMQ & Hutch
RabbitMQ & HutchRabbitMQ & Hutch
RabbitMQ & Hutch
 
AMQP with RabbitMQ
AMQP with RabbitMQAMQP with RabbitMQ
AMQP with RabbitMQ
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 
An update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinAn update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael Klishin
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQP
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
AMQP for phpMelb
AMQP for phpMelbAMQP for phpMelb
AMQP for phpMelb
 
Distributed messaging with AMQP
Distributed messaging with AMQPDistributed messaging with AMQP
Distributed messaging with AMQP
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
Amqp Basic
Amqp BasicAmqp Basic
Amqp Basic
 
Spring RabbitMQ
Spring RabbitMQSpring RabbitMQ
Spring RabbitMQ
 
A walk-through of the design and architecture of RabbitMQ - Ayanda Dube
A walk-through of the design and architecture of RabbitMQ - Ayanda DubeA walk-through of the design and architecture of RabbitMQ - Ayanda Dube
A walk-through of the design and architecture of RabbitMQ - Ayanda Dube
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
 
RabbitMQ
RabbitMQRabbitMQ
RabbitMQ
 
What we've learned from running thousands of production RabbitMQ clusters - L...
What we've learned from running thousands of production RabbitMQ clusters - L...What we've learned from running thousands of production RabbitMQ clusters - L...
What we've learned from running thousands of production RabbitMQ clusters - L...
 
Messaging with amqp and rabbitmq
Messaging with amqp and rabbitmqMessaging with amqp and rabbitmq
Messaging with amqp and rabbitmq
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
 

Viewers also liked

Messaging in the Cloud - AMQP, RabbitMQ and Spring
Messaging in the Cloud - AMQP, RabbitMQ and SpringMessaging in the Cloud - AMQP, RabbitMQ and Spring
Messaging in the Cloud - AMQP, RabbitMQ and SpringEberhard Wolff
 
Introduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal LabsIntroduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal LabsAlvaro Videla
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introductionShirish Bari
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data IngestionAlvaro Videla
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffJAX London
 

Viewers also liked (6)

Messaging in the Cloud - AMQP, RabbitMQ and Spring
Messaging in the Cloud - AMQP, RabbitMQ and SpringMessaging in the Cloud - AMQP, RabbitMQ and Spring
Messaging in the Cloud - AMQP, RabbitMQ and Spring
 
Introduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal LabsIntroduction to RabbitMQ | Meetup at Pivotal Labs
Introduction to RabbitMQ | Meetup at Pivotal Labs
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introduction
 
RabbitMQ Messaging
RabbitMQ MessagingRabbitMQ Messaging
RabbitMQ Messaging
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data Ingestion
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
 

Similar to RabbitMQ And Nanite

Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Paolo Negri
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber WeaponryJoshua L. Davis
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkTomas Doran
 
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
 
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQAlvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQTanya Denisyuk
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threadsmperham
 
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...Ontico
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionOrtus Solutions, Corp
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For BeginnersRamnath Shenoy
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoTareque Hossain
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)daylerees
 
Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Raymond Roestenburg
 
Ruby Microservices with RabbitMQ
Ruby Microservices with RabbitMQRuby Microservices with RabbitMQ
Ruby Microservices with RabbitMQZoran Majstorovic
 
OTP, Concurrency and Testing Strategies
OTP, Concurrency and Testing StrategiesOTP, Concurrency and Testing Strategies
OTP, Concurrency and Testing StrategiesAdrián Mugnolo
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640LLC NewLink
 

Similar to RabbitMQ And Nanite (20)

Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
 
MPI n OpenMP
MPI n OpenMPMPI n OpenMP
MPI n OpenMP
 
The bigrabbit
The bigrabbitThe bigrabbit
The bigrabbit
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber Weaponry
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
 
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
 
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQAlvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threads
 
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusion
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For Beginners
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
 
Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011
 
Rooster Tech Talk
Rooster Tech TalkRooster Tech Talk
Rooster Tech Talk
 
Ruby Microservices with RabbitMQ
Ruby Microservices with RabbitMQRuby Microservices with RabbitMQ
Ruby Microservices with RabbitMQ
 
OTP, Concurrency and Testing Strategies
OTP, Concurrency and Testing StrategiesOTP, Concurrency and Testing Strategies
OTP, Concurrency and Testing Strategies
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 

More from mattmatt

Cloud Conf - Datenbanken in der Cloud
Cloud Conf - Datenbanken in der CloudCloud Conf - Datenbanken in der Cloud
Cloud Conf - Datenbanken in der Cloudmattmatt
 
Redis - N✮SQL Berlin
Redis - N✮SQL BerlinRedis - N✮SQL Berlin
Redis - N✮SQL Berlinmattmatt
 
Mein Freund Der Legacy Code
Mein Freund Der Legacy CodeMein Freund Der Legacy Code
Mein Freund Der Legacy Codemattmatt
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Rubymattmatt
 
Upstream Goes To Maine
Upstream Goes To MaineUpstream Goes To Maine
Upstream Goes To Mainemattmatt
 
Smalltalk on Git
Smalltalk on GitSmalltalk on Git
Smalltalk on Gitmattmatt
 

More from mattmatt (6)

Cloud Conf - Datenbanken in der Cloud
Cloud Conf - Datenbanken in der CloudCloud Conf - Datenbanken in der Cloud
Cloud Conf - Datenbanken in der Cloud
 
Redis - N✮SQL Berlin
Redis - N✮SQL BerlinRedis - N✮SQL Berlin
Redis - N✮SQL Berlin
 
Mein Freund Der Legacy Code
Mein Freund Der Legacy CodeMein Freund Der Legacy Code
Mein Freund Der Legacy Code
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Ruby
 
Upstream Goes To Maine
Upstream Goes To MaineUpstream Goes To Maine
Upstream Goes To Maine
 
Smalltalk on Git
Smalltalk on GitSmalltalk on Git
Smalltalk on Git
 

Recently uploaded

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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 Nanonetsnaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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 WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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 productivityPrincipled Technologies
 
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 interpreternaman860154
 
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.pptxEarley Information Science
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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 slidevu2urc
 
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 Processorsdebabhi2
 
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 MenDelhi Call girls
 

Recently uploaded (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
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
 
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
 

RabbitMQ And Nanite

  • 1. RabbitMQ and Nanite Scalable Messaging Mathias Meyer, Peritor GmbH
  • 2.
  • 3. The Problem • A scalable backend to offload asynchronous tasks • Self-configuring • Self-healing • Self-assembling • But not a lot of people have it
  • 4. The Problem • I’m still learning about the nitty-gritty details
  • 5. Protocols • JMS • MQ • XMPP • SMTP (yep, for real) • STOMP • RestMS • Wtf?
  • 6.
  • 8. AMQP • Open standard for messaging middleware • Vendor neutral • Wire level protocol • Mandates interoperatibility • Abundant number of libraries that speak it
  • 9. AMQP • Supports publish/subscribe and point-to-point messaging, among others
  • 10. AMQP Components • Broker • Combination of Exchange and a Queue • Exchange routes messages (stateless) based on patterns • Queue buffers messages (stateful) • Bound by Bindings
  • 11. AMQP Components • Consumer • Producer • Messages (duh!)
  • 12.
  • 14. RabbitMQ • Erlang-based, independent AMQP implementation • Some 6k lines of code • Apache Qpid (Java): 142k lines of code • Also speaks STOMP, SMTP, XMPP and HTTP • Message persistence uses a journal • Wicked fast
  • 15.
  • 16.
  • 17.
  • 18. RabbitMQ • port install rabbitmq-server • It just works™ • rabbitmqctl • Can be clustered through Erlang’s distributed nodes
  • 19. Nanite • A self-assembling fabric of Ruby daemons • Uses mappers, agents and actors • Mappers route message requests • Agents handle messages • Actors offer specific services bundled into agents
  • 20. Nanite • Messages can be simple pushes • Or requests waiting for a response
  • 21. Nanite Agent Agent Mapper RabbitMQ Agent Mapper Agent
  • 23. Nanite Agents class Reactor include Nanite::Actor expose :react def react(payload) "reacting to message with payload: #{payload}" end end
  • 25. Nanite • Agents register themselves and advertise their services, constantly pinging the mappers • Mappers remove timed-out agents • Work distributed based on agent load
  • 26. Nanite • Agents can interoperate with each other during one single message processing • Mapper state can (and should) be stored in redis • Mappers live inside your application or standalone
  • 27. Intermediate Messages class Reactor include Nanite::Actor expose :react def react(payload) request("/worker/work", "kill all humans", :intermediate_handler => lambda {|res| puts res}) # working, working... yield "I'm almost done" # cleanup the mess "done reacting to message with payload: #{payload}" end end
  • 28. Intermediate Messages class Worker include Nanite::Actor expose :work def work(payload) Human.all.each do |human| human.destroy yield "Destroyed human #{human.name}" end "Killed all the humans" end end
  • 29. Nanite Internals • Based on EventMachine and Ruby amqp library (also EventMachine-based) • Everything runs in the EventMachine loop
  • 30. Nanite Internals • Uses a combination of the following queues to work • Registration queue • Heartbeat queue • Advertise queue • Agent queues
  • 31. Nanite Internals • Messages can be encrypted and signed between agents and mappers • Sends marshaled Ruby (default),YAML or JSON • The code internals are actually mind-boggling
  • 32. Nanite Boos • Poor documentation • A not too great test suite
  • 33. So how do we use it? That really is a topic for another talk, isn’t it?
  • 34. So how do we use it? That really is a topic for another talk, isn’t it?
  • 35. Resources • http://skillsmatter.com/podcast/erlang/alexis-richardson- introduction-to-rabbitmq • http://skillsmatter.com/podcast/erlang/rabbitmq-internal- architecture-tony-garnock-jones • http://brainspl.at/articles/2008/10/11/merbcamp-keynote-and- introducing-nanite • http://github.com/ezmobius/nanite • http://www.rabbitmq.com • http://www.amqp.org • http://www.slideshare.net/somic/introduction-to-amqp-messaging- with-rabbitmq