SlideShare a Scribd company logo
RabbitMQ and Nanite
 Scalable Messaging
  Mathias Meyer, Peritor GmbH
RabbitMQ And Nanite
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?
RabbitMQ And Nanite
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 And Nanite
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 And Nanite
RabbitMQ And Nanite
RabbitMQ And Nanite
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
Ad

More Related Content

What's hot (20)

RabbitMQ & Hutch
RabbitMQ & HutchRabbitMQ & Hutch
RabbitMQ & Hutch
Peter Hamilton
 
AMQP with RabbitMQ
AMQP with RabbitMQAMQP with RabbitMQ
AMQP with RabbitMQ
Spyros Papageorgiou
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
Martin Toshev
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
All 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 Klishin
RabbitMQ Summit
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
POSSCON
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQP
voluntas
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
Eberhard Wolff
 
AMQP for phpMelb
AMQP for phpMelbAMQP for phpMelb
AMQP for phpMelb
Wee Keat Chin
 
Distributed messaging with AMQP
Distributed messaging with AMQPDistributed messaging with AMQP
Distributed messaging with AMQP
Wee Keat Chin
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
Naukri.com
 
Amqp Basic
Amqp BasicAmqp Basic
Amqp Basic
Rahul Agrawal
 
Spring RabbitMQ
Spring RabbitMQSpring RabbitMQ
Spring RabbitMQ
Martin Toshev
 
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 Summit
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
Wee Keat Chin
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
Knoldus Inc.
 
RabbitMQ
RabbitMQRabbitMQ
RabbitMQ
Lenz Gschwendtner
 
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 rabbitmq
Selasie Hanson
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
Nahidul Kibria
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
Martin Toshev
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
All 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 Klishin
RabbitMQ Summit
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
POSSCON
 
XMPP & AMQP
XMPP & AMQPXMPP & AMQP
XMPP & AMQP
voluntas
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
Eberhard Wolff
 
Distributed messaging with AMQP
Distributed messaging with AMQPDistributed messaging with AMQP
Distributed messaging with AMQP
Wee Keat Chin
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
Naukri.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 Dube
RabbitMQ Summit
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
Wee Keat Chin
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
Knoldus 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 rabbitmq
Selasie Hanson
 
Scaling application with RabbitMQ
Scaling application with RabbitMQScaling application with RabbitMQ
Scaling application with RabbitMQ
Nahidul Kibria
 

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
Eberhard 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 Labs
Alvaro Videla
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introduction
Shirish Bari
 
RabbitMQ Messaging
RabbitMQ MessagingRabbitMQ Messaging
RabbitMQ Messaging
Marcus Crafter
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data Ingestion
Alvaro 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 Wolff
JAX London
 
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
Eberhard 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 Labs
Alvaro Videla
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introduction
Shirish Bari
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data Ingestion
Alvaro 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 Wolff
JAX London
 
Ad

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...
Paolo Negri
 
MPI n OpenMP
MPI n OpenMPMPI n OpenMP
MPI n OpenMP
Surinder Kaur
 
The bigrabbit
The bigrabbitThe bigrabbit
The bigrabbit
TarjeiRomtveit
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber Weaponry
Joshua 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 framework
Tomas 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 RabbitMQ
Tanya Denisyuk
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threads
mperham
 
Построение распределенной системы сбора данных с помощью 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 ColdFusion
Ortus Solutions, Corp
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For Beginners
Ramnath 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 django
Tareque 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 2011
Raymond Roestenburg
 
Rooster Tech Talk
Rooster Tech TalkRooster Tech Talk
Rooster Tech Talk
Chris Johnson
 
Ruby Microservices with RabbitMQ
Ruby Microservices with RabbitMQRuby Microservices with RabbitMQ
Ruby Microservices with RabbitMQ
Zoran Majstorovic
 
OTP, Concurrency and Testing Strategies
OTP, Concurrency and Testing StrategiesOTP, Concurrency and Testing Strategies
OTP, Concurrency and Testing Strategies
Adriá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-deployment2640
Newlink
 
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
Newlink
 
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
LLC NewLink
 
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 Weaponry
Joshua 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 framework
Tomas 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 RabbitMQ
Tanya Denisyuk
 
Actors and Threads
Actors and ThreadsActors and Threads
Actors and Threads
mperham
 
Построение распределенной системы сбора данных с помощью 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 ColdFusion
Ortus Solutions, Corp
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For Beginners
Ramnath 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 django
Tareque 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 2011
Raymond Roestenburg
 
Ruby Microservices with RabbitMQ
Ruby Microservices with RabbitMQRuby Microservices with RabbitMQ
Ruby Microservices with RabbitMQ
Zoran Majstorovic
 
OTP, Concurrency and Testing Strategies
OTP, Concurrency and Testing StrategiesOTP, Concurrency and Testing Strategies
OTP, Concurrency and Testing Strategies
Adriá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-deployment2640
Newlink
 
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
Newlink
 
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
LLC NewLink
 
Ad

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
mattmatt
 
Redis - N✮SQL Berlin
Redis - N✮SQL BerlinRedis - N✮SQL Berlin
Redis - N✮SQL Berlin
mattmatt
 
Mein Freund Der Legacy Code
Mein Freund Der Legacy CodeMein Freund Der Legacy Code
Mein Freund Der Legacy Code
mattmatt
 
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
mattmatt
 
Upstream Goes To Maine
Upstream Goes To MaineUpstream Goes To Maine
Upstream Goes To Maine
mattmatt
 
Smalltalk on Git
Smalltalk on GitSmalltalk on Git
Smalltalk on Git
mattmatt
 
Cloud Conf - Datenbanken in der Cloud
Cloud Conf - Datenbanken in der CloudCloud Conf - Datenbanken in der Cloud
Cloud Conf - Datenbanken in der Cloud
mattmatt
 
Redis - N✮SQL Berlin
Redis - N✮SQL BerlinRedis - N✮SQL Berlin
Redis - N✮SQL Berlin
mattmatt
 
Mein Freund Der Legacy Code
Mein Freund Der Legacy CodeMein Freund Der Legacy Code
Mein Freund Der Legacy Code
mattmatt
 
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
mattmatt
 
Upstream Goes To Maine
Upstream Goes To MaineUpstream Goes To Maine
Upstream Goes To Maine
mattmatt
 
Smalltalk on Git
Smalltalk on GitSmalltalk on Git
Smalltalk on Git
mattmatt
 

Recently uploaded (20)

Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 

RabbitMQ And Nanite

  • 1. RabbitMQ and Nanite Scalable Messaging Mathias Meyer, Peritor GmbH
  • 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?
  • 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!)
  • 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
  • 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