SlideShare a Scribd company logo
Massaging the Pony:Message Queues and You Shawn Rider PBS Education DjangoCon 2010 http://www.flickr.com/photos/funtik/1175522045
What is a Message Queue? A system for enabling asynchronous processing of discrete tasks. Super awesome. http://www.flickr.com/photos/gadl/89650415
What are they good for? Alleviate server issues by offloading processing http://www.flickr.com/photos/islandgyrl/3197469932
What are they good for? Make better user experiences http://www.flickr.com/photos/bbaltimore/6779682
What are they good for? Increase the reliability of third party service integrations.
What are they good for? Background media processing http://www.flickr.com/photos/factoryjoe/2882992091
What are they good for?  Repeating Tasks can replace Cron jobs   Keep all your code in your project
Available MQ Solutions There are many solutions out there. To name a few of them: RabbitMQ Amazon Simple Queue System Apache MQ Gearman OpenAMQ Peafowl Q4M Starling Sun Java System Message Queue
Message Queue Protocols AMQP: Advanced Message Queuing Protocol JMS: Java Messaging Service STOMP: Streaming Text Oriented Messaging Protocol
Criteria for Broker Selection The following criteria were important to us in selecting a solution. You may have some different needs. Handling exceptions and recovery Low level of required maintenance Ease of deployment Persistent queuing Community support What language is it written in? How compatible is that with our current systems? Cluster support
Failsafe MQ Brokers Must be able to survive a server failure. Upon restarting the MQ Broker, processing should resume from the last un-processed messages in queues
Queue Durability The Messages Queue Broker must be able to reconstruct the queues when it is restarted. http://www.flickr.com/photos/raul/846318014
Message Persistence The Messages (tasks to be completed) must persist between shutdowns and restarts of MQ Server
Our Choice Celery (a Django task management app) Carrot (Django middleware) PyAMQP (Python module) RabbitMQ (MQ Broker software)
The Production System Webapp Rabbit MQ Celery Worker Server(s) Database
MQ in Development Environs It is important to be able to develop Message Queue tasks in Django without being concerned about running the broker process, queue setup, persistence etc.
MQ in Development Environs CARROT_BACKEND = ‘qhettoq.taproot.Database’ Carrot can be set up to use different queuing backend for development purposes GhettoQ provides database backend for carrot where a database serves as the queue storage The broker is a simple Django application that monitors the queue in DB Inefficient, therefore only suitable for development environments
Ease a future MQ implementation Isolate functionality into reusable components.
Recycle Existing Code
Django, HTTP Requests & MQ Most functionalities provided throughDjangoapplications are tightly coupled with HTTP requests e.g. form data processing In order to asynchronously execute a task, Celery (any task management platform) must serialize & store parameters HTTP requests are usually large and not easily serializable. e.g. WSGI requests
ThePickleableHTTPRequestObject
UsingPickleableHttpRequest if request.GET.get(‘download’): try:         result = EnrollmentCSVExportTask.delay( PickleableHttpRequest(                 request,                  attributes=br />                [‘user’, ‘admin_current_organization’]             )         )
Making Message Queue Tasks It is fast and easy to add a decorator to specific functions to create Message Queue tasks. from celery.decoratorsimport task @task def add(x, y): return x + y
Explicitly Inherit from Celery’s Task Object
Then What? Some Message Queue tasks can complete with no notification required. For other tasks: Notify by email Use an AJAX listener to notify users Some other messaging
In Review Choose your MQ solution wisely Set up a robust system Leverage your existing code Replace trouble spots as they come up Profit!
Message Queues Make Life Better
References and Links Second Life’s Survey of Message Queues:http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes Ask SolemHoel’sGithub Repos:  http://github.com/ask Celery Project: http://celeryproject.org/ PickleableHttpRequest by NowellStrite (@nowells) http://gist.github.com/571027 Special thanks to TarequeHossain (http://codexn.com)

More Related Content

What's hot

Accessing Mule variables in groovy
Accessing Mule variables in groovyAccessing Mule variables in groovy
Accessing Mule variables in groovy
Anirban Sen Chowdhary
 
Messaging with the Docker
Messaging with the DockerMessaging with the Docker
Messaging with the Docker
Henryk Konsek
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to Prometheus
Julien Pivotto
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
Minal Maniar
 
jLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoTjLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoT
Iván López Martín
 
Performance tests with gatling
Performance tests with gatlingPerformance tests with gatling
Performance tests with gatling
SoftwareMill
 
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Javantura v3 - ES6 – Future Is Now – Nenad PečanacJavantura v3 - ES6 – Future Is Now – Nenad Pečanac
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012slandelle
 
Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012slandelle
 
Migrating to java 9 modules
Migrating to java 9 modulesMigrating to java 9 modules
Migrating to java 9 modules
Paul Bakker
 
Celery introduction
Celery introductionCelery introduction
Celery introduction
Ionel Mărieș Cristian
 
Kafka monitoring and metrics
Kafka monitoring and metricsKafka monitoring and metrics
Kafka monitoring and metrics
Touraj Ebrahimi
 
java servlet and servlet programming
java servlet and servlet programmingjava servlet and servlet programming
java servlet and servlet programming
Kumar
 
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Sylvain Zimmer
 
Gatling
GatlingGatling
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Su Zin Kyaw
 

What's hot (17)

Accessing Mule variables in groovy
Accessing Mule variables in groovyAccessing Mule variables in groovy
Accessing Mule variables in groovy
 
Messaging with the Docker
Messaging with the DockerMessaging with the Docker
Messaging with the Docker
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to Prometheus
 
Servlet lifecycle
Servlet lifecycleServlet lifecycle
Servlet lifecycle
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
jLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoTjLove 2020 - Micronaut and graalvm: The power of AoT
jLove 2020 - Micronaut and graalvm: The power of AoT
 
Performance tests with gatling
Performance tests with gatlingPerformance tests with gatling
Performance tests with gatling
 
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Javantura v3 - ES6 – Future Is Now – Nenad PečanacJavantura v3 - ES6 – Future Is Now – Nenad Pečanac
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
 
Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012Hands On, Duchess 10/17/2012
Hands On, Duchess 10/17/2012
 
Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012
 
Migrating to java 9 modules
Migrating to java 9 modulesMigrating to java 9 modules
Migrating to java 9 modules
 
Celery introduction
Celery introductionCelery introduction
Celery introduction
 
Kafka monitoring and metrics
Kafka monitoring and metricsKafka monitoring and metrics
Kafka monitoring and metrics
 
java servlet and servlet programming
java servlet and servlet programmingjava servlet and servlet programming
java servlet and servlet programming
 
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
 
Gatling
GatlingGatling
Gatling
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 

Similar to Massaging the Pony: Message Queues and You

Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
Matthew McCullough
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
mattjive
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
Mu Chun Wang
 
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Jimmy DeadcOde
 
Surekha_haoop_exp
Surekha_haoop_expSurekha_haoop_exp
Surekha_haoop_expsurekhakadi
 
Evolution of netflix conductor
Evolution of netflix conductorEvolution of netflix conductor
Evolution of netflix conductor
vedu12
 
MY NEWEST RESUME
MY NEWEST RESUMEMY NEWEST RESUME
MY NEWEST RESUMEHan Yan
 
MY NEWEST RESUME
MY NEWEST RESUMEMY NEWEST RESUME
MY NEWEST RESUMEHan Yan
 
How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...
Katia Aresti
 
jRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting ServicejRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting Service
Gunnar Hillert
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
QAware GmbH
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
Mario-Leander Reimer
 
MY NEWEST RESUME
MY NEWEST RESUMEMY NEWEST RESUME
MY NEWEST RESUMEHan Yan
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystems
Nuno Caneco
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
Oracle Korea
 
Spring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringSpring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics Monitoring
DonghuKIM2
 
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
Craeg Strong
 
Empowering Magnolia for Enterprise Use Cases - Experience Report
Empowering Magnolia for Enterprise Use Cases - Experience ReportEmpowering Magnolia for Enterprise Use Cases - Experience Report
Empowering Magnolia for Enterprise Use Cases - Experience Report
bkraft
 
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
John Staveley
 

Similar to Massaging the Pony: Message Queues and You (20)

Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2Google App Engine for Java v0.0.2
Google App Engine for Java v0.0.2
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
 
Surekha_haoop_exp
Surekha_haoop_expSurekha_haoop_exp
Surekha_haoop_exp
 
.net Framework
.net Framework.net Framework
.net Framework
 
Evolution of netflix conductor
Evolution of netflix conductorEvolution of netflix conductor
Evolution of netflix conductor
 
MY NEWEST RESUME
MY NEWEST RESUMEMY NEWEST RESUME
MY NEWEST RESUME
 
MY NEWEST RESUME
MY NEWEST RESUMEMY NEWEST RESUME
MY NEWEST RESUME
 
How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...How and why we evolved a legacy Java web application to Scala... and we are s...
How and why we evolved a legacy Java web application to Scala... and we are s...
 
jRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting ServicejRecruiter - The AJUG Job Posting Service
jRecruiter - The AJUG Job Posting Service
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 
MY NEWEST RESUME
MY NEWEST RESUMEMY NEWEST RESUME
MY NEWEST RESUME
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystems
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
 
Spring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics MonitoringSpring Boot - Microservice Metrics Monitoring
Spring Boot - Microservice Metrics Monitoring
 
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
20211202 North America DevOps Group NADOG Adapting to Covid With Serverless C...
 
Empowering Magnolia for Enterprise Use Cases - Experience Report
Empowering Magnolia for Enterprise Use Cases - Experience ReportEmpowering Magnolia for Enterprise Use Cases - Experience Report
Empowering Magnolia for Enterprise Use Cases - Experience Report
 
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
 

More from Shawn Rider

Work is not a Dare: Tips for Building Inclusive Teams
Work is not a Dare: Tips for Building Inclusive TeamsWork is not a Dare: Tips for Building Inclusive Teams
Work is not a Dare: Tips for Building Inclusive Teams
Shawn Rider
 
Theming Sites with SASS
Theming Sites with SASSTheming Sites with SASS
Theming Sites with SASS
Shawn Rider
 
Living Syleguides
Living SyleguidesLiving Syleguides
Living Syleguides
Shawn Rider
 
Intro to Yo
Intro to YoIntro to Yo
Intro to Yo
Shawn Rider
 
Barbarians at the Gate: Games and Culture
Barbarians at the Gate: Games and CultureBarbarians at the Gate: Games and Culture
Barbarians at the Gate: Games and Culture
Shawn Rider
 
Django Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, TricksDjango Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, Tricks
Shawn Rider
 
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django SiteTeaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Shawn Rider
 
How To Succeed In Web Design
How To Succeed In Web DesignHow To Succeed In Web Design
How To Succeed In Web Design
Shawn Rider
 

More from Shawn Rider (8)

Work is not a Dare: Tips for Building Inclusive Teams
Work is not a Dare: Tips for Building Inclusive TeamsWork is not a Dare: Tips for Building Inclusive Teams
Work is not a Dare: Tips for Building Inclusive Teams
 
Theming Sites with SASS
Theming Sites with SASSTheming Sites with SASS
Theming Sites with SASS
 
Living Syleguides
Living SyleguidesLiving Syleguides
Living Syleguides
 
Intro to Yo
Intro to YoIntro to Yo
Intro to Yo
 
Barbarians at the Gate: Games and Culture
Barbarians at the Gate: Games and CultureBarbarians at the Gate: Games and Culture
Barbarians at the Gate: Games and Culture
 
Django Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, TricksDjango Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, Tricks
 
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django SiteTeaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
Teaching an Old Pony New Tricks: Maintaining and Updating and Aging Django Site
 
How To Succeed In Web Design
How To Succeed In Web DesignHow To Succeed In Web Design
How To Succeed In Web Design
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

Massaging the Pony: Message Queues and You

  • 1. Massaging the Pony:Message Queues and You Shawn Rider PBS Education DjangoCon 2010 http://www.flickr.com/photos/funtik/1175522045
  • 2. What is a Message Queue? A system for enabling asynchronous processing of discrete tasks. Super awesome. http://www.flickr.com/photos/gadl/89650415
  • 3. What are they good for? Alleviate server issues by offloading processing http://www.flickr.com/photos/islandgyrl/3197469932
  • 4. What are they good for? Make better user experiences http://www.flickr.com/photos/bbaltimore/6779682
  • 5. What are they good for? Increase the reliability of third party service integrations.
  • 6. What are they good for? Background media processing http://www.flickr.com/photos/factoryjoe/2882992091
  • 7. What are they good for? Repeating Tasks can replace Cron jobs Keep all your code in your project
  • 8. Available MQ Solutions There are many solutions out there. To name a few of them: RabbitMQ Amazon Simple Queue System Apache MQ Gearman OpenAMQ Peafowl Q4M Starling Sun Java System Message Queue
  • 9. Message Queue Protocols AMQP: Advanced Message Queuing Protocol JMS: Java Messaging Service STOMP: Streaming Text Oriented Messaging Protocol
  • 10. Criteria for Broker Selection The following criteria were important to us in selecting a solution. You may have some different needs. Handling exceptions and recovery Low level of required maintenance Ease of deployment Persistent queuing Community support What language is it written in? How compatible is that with our current systems? Cluster support
  • 11. Failsafe MQ Brokers Must be able to survive a server failure. Upon restarting the MQ Broker, processing should resume from the last un-processed messages in queues
  • 12. Queue Durability The Messages Queue Broker must be able to reconstruct the queues when it is restarted. http://www.flickr.com/photos/raul/846318014
  • 13. Message Persistence The Messages (tasks to be completed) must persist between shutdowns and restarts of MQ Server
  • 14. Our Choice Celery (a Django task management app) Carrot (Django middleware) PyAMQP (Python module) RabbitMQ (MQ Broker software)
  • 15. The Production System Webapp Rabbit MQ Celery Worker Server(s) Database
  • 16. MQ in Development Environs It is important to be able to develop Message Queue tasks in Django without being concerned about running the broker process, queue setup, persistence etc.
  • 17. MQ in Development Environs CARROT_BACKEND = ‘qhettoq.taproot.Database’ Carrot can be set up to use different queuing backend for development purposes GhettoQ provides database backend for carrot where a database serves as the queue storage The broker is a simple Django application that monitors the queue in DB Inefficient, therefore only suitable for development environments
  • 18. Ease a future MQ implementation Isolate functionality into reusable components.
  • 20. Django, HTTP Requests & MQ Most functionalities provided throughDjangoapplications are tightly coupled with HTTP requests e.g. form data processing In order to asynchronously execute a task, Celery (any task management platform) must serialize & store parameters HTTP requests are usually large and not easily serializable. e.g. WSGI requests
  • 22. UsingPickleableHttpRequest if request.GET.get(‘download’): try: result = EnrollmentCSVExportTask.delay( PickleableHttpRequest( request, attributes=br /> [‘user’, ‘admin_current_organization’] ) )
  • 23. Making Message Queue Tasks It is fast and easy to add a decorator to specific functions to create Message Queue tasks. from celery.decoratorsimport task @task def add(x, y): return x + y
  • 24. Explicitly Inherit from Celery’s Task Object
  • 25. Then What? Some Message Queue tasks can complete with no notification required. For other tasks: Notify by email Use an AJAX listener to notify users Some other messaging
  • 26. In Review Choose your MQ solution wisely Set up a robust system Leverage your existing code Replace trouble spots as they come up Profit!
  • 27. Message Queues Make Life Better
  • 28. References and Links Second Life’s Survey of Message Queues:http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes Ask SolemHoel’sGithub Repos: http://github.com/ask Celery Project: http://celeryproject.org/ PickleableHttpRequest by NowellStrite (@nowells) http://gist.github.com/571027 Special thanks to TarequeHossain (http://codexn.com)

Editor's Notes

  1. Example from TL about bulk refunds and paypal.
  2. Cron jobs essentially pass control of your code to the operating system. Although the Cron job is a valuable tool, it’s not the only option.
  3. Because a Message Queue Broker is a separate system that your project interfaces with, you could feasibly use many different apps created in many different languages.
  4. Cluster support will be a priority for a lot of people, but it was not a priority for us. (Cluster support is the ability to have a cluster of MQ Brokers.)
  5. To achieve this, we consider two concepts (on next slides).
  6. This is what that looks like in production. Many of these components exist on dedicated servers and/or server clusters.
  7. Some people who are more familiar with Carrot and Celery might wonder why not use the “always eager” setting, which processes MQ tasks in real time. However, in our experience that setting does not provide the effect we are after, and it is frustrating to get timeouts on long-running processes in development.
  8. You want to replace trouble spots in your project as they come up. No need to rewrite your entire project right away.
  9. The MockHTTP object always serializes GET and POST data. It then saves any additional HTTPRequest attributes specified when it is called.