SlideShare a Scribd company logo
1 of 15
RabbitMQ
From a programmer viewpoint
Who am I? What we do?
- Marçal Berga, born in Roda de Ter, from Lluçanès, living in miami
- PHP Lover for 6+ years
- Unit tester
- Project Manager at Edicions Digitals Del Camp.
- National level digital newspapers
- +10 content sites
- Over 3M daily unique visitors
- Top 10 Catalan newspaper in catalunya (delcamp.cat)
- 100% custom software
delcamp.cat | catalunyadiari.cat | diaridecatalunya.cat | espanadiario.es | horoscopomagico.com | caracterurbano.com | laguiafemenenia.com |
catalunyacuina.cat | valenciadiari.com | ...
RabbitMQ
Basic concepts
RabbitMQ
- Message Broker
- Native AMQP (advanced messaging queue protocol) support
- STOMP (Simple Text Oriented Messaging Protocol) via plugin
- MQTT (Message Queuing Telemetry Transport) via plugin
- Made with Erlang
- Cluster ready
- HTTP API for stats and management
- Multiple plugins
What we’ll see?
- Producer:
- Who creates the messages and pushes them to RabbitMQ.
- Message:
- data to transfer between apps/services
- Exchange:
- Receives messages and routes them to queues.
- Queue:
- just that, a queue.
- Consumer/worker:
- Takes messages from queue and does things.
- Examples are made with python and pika library.
Producer
- Creates messages and sends them to exchange.
- Important: make sure queue and exchange exist and are binded. If rabbit can
not route message it will be returned or lost in case of miscunfiguration.
Message
- Contents all information passed between services/apps
- Contents information/headers
- Automatically added by broker (x-something)
- Added by publisher (opaque to broker)
- Routing key
- Body
Exchange
- Receives messages from publisher.
- Routes messages to correct queue.
- Acks messages to publisher.
- Fanout Exchange:
- delivers messages to ALL binded queues.
- Direct exchange:
- routes message by full routing key.
- Topic exchange:
- routes message by routing key with woldcars.
Fanout routing
Publisher Exchange
Queue 1
Queue 2
Queue 3
Delivers message to ALL binded queues, without working with routes.
So, we can send any message and it will be delivered to ALL queues
Direct routing
Publisher Exchange
Queue 1
Queue 2
Queue 3
route.1
route.2
route.3
Delivers message to matching route binded queues.
So, if we send a message with routing = “route.1” it will be delivered to Queue 1 and so on
Topic routing
Publisher Exchange
Queue 1
Queue 2
Queue 3
app.log.*
app.notify.*
app.#
Delivers message to rules based route(s) binded queues.
Using wildcards (* and #) we can set rules of routing. * mean any ONE value; # mean ANY ANY values.
- app.log.error and app.log.info will be delivered to Queue 1 and Queue 3.
- app.notify.admin will be delivered to Queue 2 and Queue 3.
- app.random.facts.longer.routing will be delivered to Queue 3.
tryrabbitmq.com
Simulate routings and delivers easily!
Consuming messages
Consumer gets messages from a queue and does magic with that.
Consumer should acknowledge, reject or deny message.
- Acknowledge => OK
- Reject => Won’t do
- Deny => KO
Rabbit delivers message with a delivery tag for each message.
- Delivery tag is not unique!
Dead-lettering
Messages nacked can be requeued to same queue, discarted or dead-lettered.
- We need a dead letter exchange (DLX) created.
- Queue will have x-dead-letter-exchange attribute.
- Exchanges also can have a DLX to dead-letter messages not queued.
- Works like any other exchange nor queue.
Rabbitmq @ tgndevs meetup

More Related Content

Similar to Rabbitmq @ tgndevs meetup

Mule with rabbit mq
Mule with rabbit mq Mule with rabbit mq
Mule with rabbit mq mdfkhan625
 
Mule with rabbitmq
Mule with rabbitmqMule with rabbitmq
Mule with rabbitmqRajkattamuri
 
Mule with rabbit mq
Mule with rabbit mq Mule with rabbit mq
Mule with rabbit mq javeed_mhd
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mqKhan625
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQJames Carr
 
Adaptive Traffic Sampling and Management Platform
Adaptive Traffic Sampling and Management PlatformAdaptive Traffic Sampling and Management Platform
Adaptive Traffic Sampling and Management PlatformAmir Krifa
 
Rabbit Mq in Mule
Rabbit Mq in MuleRabbit Mq in Mule
Rabbit Mq in MuleMohammed246
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mqHasan Syed
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - KafkaMayank Bansal
 
Micro on NATS - Microservices with Messaging
Micro on NATS - Microservices with MessagingMicro on NATS - Microservices with Messaging
Micro on NATS - Microservices with MessagingApcera
 
Intro to MPI
Intro to MPIIntro to MPI
Intro to MPIjbp4444
 
Usp message queues
Usp message queuesUsp message queues
Usp message queuesRohitK71
 
Messaging System with Spring Boot dan RabbitMQ
Messaging System with Spring Boot dan RabbitMQMessaging System with Spring Boot dan RabbitMQ
Messaging System with Spring Boot dan RabbitMQM Firman Akbar
 
MPI message passing interface
MPI message passing interfaceMPI message passing interface
MPI message passing interfaceMohit Raghuvanshi
 

Similar to Rabbitmq @ tgndevs meetup (20)

Mule with rabbit mq
Mule with rabbit mq Mule with rabbit mq
Mule with rabbit mq
 
Mule with rabbitmq
Mule with rabbitmqMule with rabbitmq
Mule with rabbitmq
 
Mule with rabbit mq
Mule with rabbit mq Mule with rabbit mq
Mule with rabbit mq
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
 
Adaptive Traffic Sampling and Management Platform
Adaptive Traffic Sampling and Management PlatformAdaptive Traffic Sampling and Management Platform
Adaptive Traffic Sampling and Management Platform
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
Rabbit Mq in Mule
Rabbit Mq in MuleRabbit Mq in Mule
Rabbit Mq in Mule
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
An introduction to MQTT
An introduction to MQTTAn introduction to MQTT
An introduction to MQTT
 
Messaging queue - Kafka
Messaging queue - KafkaMessaging queue - Kafka
Messaging queue - Kafka
 
Mule with rabbitmq
Mule with rabbitmqMule with rabbitmq
Mule with rabbitmq
 
My ppt hpc u4
My ppt hpc u4My ppt hpc u4
My ppt hpc u4
 
Micro on NATS - Microservices with Messaging
Micro on NATS - Microservices with MessagingMicro on NATS - Microservices with Messaging
Micro on NATS - Microservices with Messaging
 
Intro to MPI
Intro to MPIIntro to MPI
Intro to MPI
 
Dcsd final report
Dcsd final reportDcsd final report
Dcsd final report
 
Usp message queues
Usp message queuesUsp message queues
Usp message queues
 
Messaging System with Spring Boot dan RabbitMQ
Messaging System with Spring Boot dan RabbitMQMessaging System with Spring Boot dan RabbitMQ
Messaging System with Spring Boot dan RabbitMQ
 
MPI message passing interface
MPI message passing interfaceMPI message passing interface
MPI message passing interface
 
Real time-embedded-system-lec-06
Real time-embedded-system-lec-06Real time-embedded-system-lec-06
Real time-embedded-system-lec-06
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

Recently uploaded (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

Rabbitmq @ tgndevs meetup

  • 2. Who am I? What we do? - Marçal Berga, born in Roda de Ter, from Lluçanès, living in miami - PHP Lover for 6+ years - Unit tester - Project Manager at Edicions Digitals Del Camp. - National level digital newspapers - +10 content sites - Over 3M daily unique visitors - Top 10 Catalan newspaper in catalunya (delcamp.cat) - 100% custom software delcamp.cat | catalunyadiari.cat | diaridecatalunya.cat | espanadiario.es | horoscopomagico.com | caracterurbano.com | laguiafemenenia.com | catalunyacuina.cat | valenciadiari.com | ...
  • 4. RabbitMQ - Message Broker - Native AMQP (advanced messaging queue protocol) support - STOMP (Simple Text Oriented Messaging Protocol) via plugin - MQTT (Message Queuing Telemetry Transport) via plugin - Made with Erlang - Cluster ready - HTTP API for stats and management - Multiple plugins
  • 5. What we’ll see? - Producer: - Who creates the messages and pushes them to RabbitMQ. - Message: - data to transfer between apps/services - Exchange: - Receives messages and routes them to queues. - Queue: - just that, a queue. - Consumer/worker: - Takes messages from queue and does things. - Examples are made with python and pika library.
  • 6. Producer - Creates messages and sends them to exchange. - Important: make sure queue and exchange exist and are binded. If rabbit can not route message it will be returned or lost in case of miscunfiguration.
  • 7. Message - Contents all information passed between services/apps - Contents information/headers - Automatically added by broker (x-something) - Added by publisher (opaque to broker) - Routing key - Body
  • 8. Exchange - Receives messages from publisher. - Routes messages to correct queue. - Acks messages to publisher. - Fanout Exchange: - delivers messages to ALL binded queues. - Direct exchange: - routes message by full routing key. - Topic exchange: - routes message by routing key with woldcars.
  • 9. Fanout routing Publisher Exchange Queue 1 Queue 2 Queue 3 Delivers message to ALL binded queues, without working with routes. So, we can send any message and it will be delivered to ALL queues
  • 10. Direct routing Publisher Exchange Queue 1 Queue 2 Queue 3 route.1 route.2 route.3 Delivers message to matching route binded queues. So, if we send a message with routing = “route.1” it will be delivered to Queue 1 and so on
  • 11. Topic routing Publisher Exchange Queue 1 Queue 2 Queue 3 app.log.* app.notify.* app.# Delivers message to rules based route(s) binded queues. Using wildcards (* and #) we can set rules of routing. * mean any ONE value; # mean ANY ANY values. - app.log.error and app.log.info will be delivered to Queue 1 and Queue 3. - app.notify.admin will be delivered to Queue 2 and Queue 3. - app.random.facts.longer.routing will be delivered to Queue 3.
  • 13. Consuming messages Consumer gets messages from a queue and does magic with that. Consumer should acknowledge, reject or deny message. - Acknowledge => OK - Reject => Won’t do - Deny => KO Rabbit delivers message with a delivery tag for each message. - Delivery tag is not unique!
  • 14. Dead-lettering Messages nacked can be requeued to same queue, discarted or dead-lettered. - We need a dead letter exchange (DLX) created. - Queue will have x-dead-letter-exchange attribute. - Exchanges also can have a DLX to dead-letter messages not queued. - Works like any other exchange nor queue.