SlideShare a Scribd company logo
RabbitMQ
message broker
How it works
Producer
• Also known as Publisher
• Part of user application
• Publishes messages to exchange (with routing key)
Exchange
• Exchanges messages between producer and queues
• Queue(s) selection depends on
• Exchange type
• Queue bindings
• Routing key the message is published with
Exchange types
• Direct - match exact routing keys
• Topic - match pattern routing keys
• Fanout - match all routing keys (ignores them)
• Headers - match exact message headers (all or any)
Bindings
• Also known as Routes
• Connection between exchange and queue/exchange
• Exchange can be bound to multiple queues
• Queue can be bound to multiple exchanges
• Exchange/Queue can be bound by multiple bindings
Direct routing
Direct routing
• Example: ImageProcessorExchange
• Image file path is sent in message body
• ImageWatermarkQueue - `image.watermark`
• Stores paths of images to watermark
• Consumer applies watermark to images
• ImageResizeQueue - `image.resize`
• Stores paths of images to watermark
• Consumer resizes images
Topic routing
Topic routing
• Example: LoggerExchange <channel>.<log level>
• FileLoggerQueue - `#`
• Stores all message
• Consumer logs message to file
• SmsLoggerQueue - `*.critical`, `*.emergency`
• Stores all critical and emergency messages
• Consumer sends alert SMS to IT support phone
Fanout routing
Fanout routing
• Example: OrderCreatedExchange
• OrderCreatedSMSQueue
• Consumer sends SMS message to customer
• OrderCreatedMailQueue
• Consumer sends mail to customer
• OrderCreatedExportQueue
• Consumer exports order to ERP system
Headers routing
• Example: FileUploadExchange
• Message with `format` header and file content in body
• ImageUploadQueue - `format=jpeg`, `format=png`
• Stores jpeg and png image files
• Consumer resizes, applies watermark and saves image
• VideoUploadQueue - `format=mp4`, `format=avi`
• Stores mp4 and avi video files
• Consumer resamples video to multiple resolutions
• Another VideoResampleExchange can be used to faster resampling
Queue
• FIFO - first in first out
• Stores messages until consumed by consumer
• Every queue is bind to default exchange
• Queue name is used as routing key
• Can be used for Dead Letter Exchange or RPC
Consumer
• Part of user application
• Consumes messages from queue
• Needs to acknowledge message
• Only if the message’s delivery mode is persistent
• Multiple instances can be used for faster processing
Message acknowledgement
• Acknowledge
• Reject
• Drop
• Re-queue (infinite loops may occur)
• Use Dead Letter Exchange instead
Questions?
we are not finished yet
Dead Letter Exchange
DLX
Dead Letter Exchange
• Allows safe rejecting messages
• not using re-queue (infinite loops)
• moves them to another queue
• Move messages back after you fix issue causing reject
• Messages can be moved back automatically after delay
Dead Letter Exchange
• While declaring queue `queue.one` use arguments
• x-dead-letter-exchange: `` //default exchange
• x-dead-letter-routing-key: `queue.one.dlx`
• Declare additional queue `queue.one.dlx`
• Now every time message from `queue.one` is rejected
(without re-queue) it is automatically dead lettered to
`queue.one.dlx`.
Dead Letter Exchange
• To automatically move messages back to original queue
you need to declare `queue.one.dlx` with dead letter
arguments routing back to original queue
• Now when `queue.one.dlx` message is rejected it will be
moved back to queue `queue.one`
• To automatically reject message after delay declare queue
`queue.one.dlx` with argument `x-message-ttl`. As value
use timeout in milliseconds
Remote Procedure
Call
RPC
Remote Procedure Call
• Sometimes you need to wait for response
• Useful for multiple (time consuming) calculations at same
time
• 10s and 15s calculations will last 15s instead of 25s
Remote Procedure Call
• RPC client (Publisher)
• generates temporary queue
• publishes message to RPC server’s exchange
• with generated queue name in message header
• starts consuming generated queue (timeout is
recommended)
Remote Procedure Call
• RPC server (Consumer)
• processes message from RPC client
• publishes response to default exchange
• using generated queue name from message header
as routing key
Questions?
Thanks!
Vít Kutný
https://vitkutny.cz

More Related Content

What's hot

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
 
A survey on SCTP
A survey on SCTPA survey on SCTP
A survey on SCTP
chanwoo Jeong
 
An intro to MQTT
An intro to MQTTAn intro to MQTT
An intro to MQTT
HassanHashemi11
 
Enterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSEnterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMS
Bruce Snyder
 
Enterprise Messaging with Apache ActiveMQ
Enterprise Messaging with Apache ActiveMQEnterprise Messaging with Apache ActiveMQ
Enterprise Messaging with Apache ActiveMQ
elliando dias
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
Naukri.com
 
Mini-Training: Message Brokers
Mini-Training: Message BrokersMini-Training: Message Brokers
Mini-Training: Message Brokers
Betclic Everest Group Tech Team
 
AMQP
AMQPAMQP
Micro on NATS - Microservices with Messaging
Micro on NATS - Microservices with MessagingMicro on NATS - Microservices with Messaging
Micro on NATS - Microservices with Messaging
Apcera
 
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
WSO2
 
Apache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System Overview
Dmitry Tolpeko
 
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
 
Making communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBusMaking communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBus
Particular Software
 
Evaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesEvaluating persistent, replicated message queues
Evaluating persistent, replicated message queues
Adam Warski
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
Max Alexejev
 
Scalable Persistent Message Brokering with WSO2 Message Broker
Scalable Persistent Message Brokering with WSO2 Message BrokerScalable Persistent Message Brokering with WSO2 Message Broker
Scalable Persistent Message Brokering with WSO2 Message Broker
Srinath Perera
 
Storing and processing data with the wso2 platform
Storing and processing data with the wso2 platformStoring and processing data with the wso2 platform
Storing and processing data with the wso2 platform
WSO2
 
Rabbitmq an amqp message broker
Rabbitmq an amqp message brokerRabbitmq an amqp message broker
Rabbitmq an amqp message broker
ANASYS
 
Mule overview
Mule overviewMule overview
Mule overview
Manav Prasad
 
RabbitMq
RabbitMqRabbitMq
RabbitMq
Ahmad Saif
 

What's hot (20)

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
 
A survey on SCTP
A survey on SCTPA survey on SCTP
A survey on SCTP
 
An intro to MQTT
An intro to MQTTAn intro to MQTT
An intro to MQTT
 
Enterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSEnterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMS
 
Enterprise Messaging with Apache ActiveMQ
Enterprise Messaging with Apache ActiveMQEnterprise Messaging with Apache ActiveMQ
Enterprise Messaging with Apache ActiveMQ
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
Mini-Training: Message Brokers
Mini-Training: Message BrokersMini-Training: Message Brokers
Mini-Training: Message Brokers
 
AMQP
AMQPAMQP
AMQP
 
Micro on NATS - Microservices with Messaging
Micro on NATS - Microservices with MessagingMicro on NATS - Microservices with Messaging
Micro on NATS - Microservices with Messaging
 
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
 
Apache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System Overview
 
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
 
Making communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBusMaking communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBus
 
Evaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesEvaluating persistent, replicated message queues
Evaluating persistent, replicated message queues
 
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
 
Scalable Persistent Message Brokering with WSO2 Message Broker
Scalable Persistent Message Brokering with WSO2 Message BrokerScalable Persistent Message Brokering with WSO2 Message Broker
Scalable Persistent Message Brokering with WSO2 Message Broker
 
Storing and processing data with the wso2 platform
Storing and processing data with the wso2 platformStoring and processing data with the wso2 platform
Storing and processing data with the wso2 platform
 
Rabbitmq an amqp message broker
Rabbitmq an amqp message brokerRabbitmq an amqp message broker
Rabbitmq an amqp message broker
 
Mule overview
Mule overviewMule overview
Mule overview
 
RabbitMq
RabbitMqRabbitMq
RabbitMq
 

Similar to RabbitMQ - message broker

Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
Ortus Solutions, Corp
 
Ruby Microservices with RabbitMQ
Ruby Microservices with RabbitMQRuby Microservices with RabbitMQ
Ruby Microservices with RabbitMQ
Zoran Majstorovic
 
RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client library
Mohammed Shaban
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
Eberhard Wolff
 
Module 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptxModule 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptx
AASTHAJAJOO
 
High scale flavour
High scale flavourHigh scale flavour
High scale flavour
Tomas Doran
 
Introduction to Messaging 3.7
Introduction to Messaging 3.7Introduction to Messaging 3.7
Introduction to Messaging 3.7
StephenKardian
 
πP
πPπP
Follow the White Rabbit - Message Queues with PHP
Follow the White Rabbit - Message Queues with PHPFollow the White Rabbit - Message Queues with PHP
Follow the White Rabbit - Message Queues with PHP
Eric Rodriguez (Hiring in Lex)
 
Making communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusMaking communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service Bus
Particular Software
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mq
devObjective
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mq
ColdFusionConference
 
Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7
StephenKardian
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdf
TarekHamdi8
 
Introduction to Kafka with Spring Integration
Introduction to Kafka with Spring IntegrationIntroduction to Kafka with Spring Integration
Introduction to Kafka with Spring Integration
Borislav Markov
 
NATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging SystemNATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging System
Shiju Varghese
 
Building an Event Bus at Scale
Building an Event Bus at ScaleBuilding an Event Bus at Scale
Building an Event Bus at Scale
jimriecken
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
Betclic Everest Group Tech Team
 
Kafka tutorial
Kafka tutorialKafka tutorial
Kafka tutorial
Srikrishna k
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
Martin Toshev
 

Similar to RabbitMQ - message broker (20)

Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
 
Ruby Microservices with RabbitMQ
Ruby Microservices with RabbitMQRuby Microservices with RabbitMQ
Ruby Microservices with RabbitMQ
 
RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client library
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
Module 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptxModule 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptx
 
High scale flavour
High scale flavourHigh scale flavour
High scale flavour
 
Introduction to Messaging 3.7
Introduction to Messaging 3.7Introduction to Messaging 3.7
Introduction to Messaging 3.7
 
πP
πPπP
πP
 
Follow the White Rabbit - Message Queues with PHP
Follow the White Rabbit - Message Queues with PHPFollow the White Rabbit - Message Queues with PHP
Follow the White Rabbit - Message Queues with PHP
 
Making communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusMaking communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service Bus
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mq
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mq
 
Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7Introduction to Long Running Workflows 3.7
Introduction to Long Running Workflows 3.7
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdf
 
Introduction to Kafka with Spring Integration
Introduction to Kafka with Spring IntegrationIntroduction to Kafka with Spring Integration
Introduction to Kafka with Spring Integration
 
NATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging SystemNATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging System
 
Building an Event Bus at Scale
Building an Event Bus at ScaleBuilding an Event Bus at Scale
Building an Event Bus at Scale
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Kafka tutorial
Kafka tutorialKafka tutorial
Kafka tutorial
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
 

Recently uploaded

Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
DianaGray10
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
Fwdays
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 

Recently uploaded (20)

Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 

RabbitMQ - message broker

  • 3. Producer • Also known as Publisher • Part of user application • Publishes messages to exchange (with routing key)
  • 4. Exchange • Exchanges messages between producer and queues • Queue(s) selection depends on • Exchange type • Queue bindings • Routing key the message is published with
  • 5. Exchange types • Direct - match exact routing keys • Topic - match pattern routing keys • Fanout - match all routing keys (ignores them) • Headers - match exact message headers (all or any)
  • 6. Bindings • Also known as Routes • Connection between exchange and queue/exchange • Exchange can be bound to multiple queues • Queue can be bound to multiple exchanges • Exchange/Queue can be bound by multiple bindings
  • 8. Direct routing • Example: ImageProcessorExchange • Image file path is sent in message body • ImageWatermarkQueue - `image.watermark` • Stores paths of images to watermark • Consumer applies watermark to images • ImageResizeQueue - `image.resize` • Stores paths of images to watermark • Consumer resizes images
  • 10. Topic routing • Example: LoggerExchange <channel>.<log level> • FileLoggerQueue - `#` • Stores all message • Consumer logs message to file • SmsLoggerQueue - `*.critical`, `*.emergency` • Stores all critical and emergency messages • Consumer sends alert SMS to IT support phone
  • 12. Fanout routing • Example: OrderCreatedExchange • OrderCreatedSMSQueue • Consumer sends SMS message to customer • OrderCreatedMailQueue • Consumer sends mail to customer • OrderCreatedExportQueue • Consumer exports order to ERP system
  • 13. Headers routing • Example: FileUploadExchange • Message with `format` header and file content in body • ImageUploadQueue - `format=jpeg`, `format=png` • Stores jpeg and png image files • Consumer resizes, applies watermark and saves image • VideoUploadQueue - `format=mp4`, `format=avi` • Stores mp4 and avi video files • Consumer resamples video to multiple resolutions • Another VideoResampleExchange can be used to faster resampling
  • 14. Queue • FIFO - first in first out • Stores messages until consumed by consumer • Every queue is bind to default exchange • Queue name is used as routing key • Can be used for Dead Letter Exchange or RPC
  • 15. Consumer • Part of user application • Consumes messages from queue • Needs to acknowledge message • Only if the message’s delivery mode is persistent • Multiple instances can be used for faster processing
  • 16. Message acknowledgement • Acknowledge • Reject • Drop • Re-queue (infinite loops may occur) • Use Dead Letter Exchange instead
  • 17. Questions? we are not finished yet
  • 19. Dead Letter Exchange • Allows safe rejecting messages • not using re-queue (infinite loops) • moves them to another queue • Move messages back after you fix issue causing reject • Messages can be moved back automatically after delay
  • 20. Dead Letter Exchange • While declaring queue `queue.one` use arguments • x-dead-letter-exchange: `` //default exchange • x-dead-letter-routing-key: `queue.one.dlx` • Declare additional queue `queue.one.dlx` • Now every time message from `queue.one` is rejected (without re-queue) it is automatically dead lettered to `queue.one.dlx`.
  • 21. Dead Letter Exchange • To automatically move messages back to original queue you need to declare `queue.one.dlx` with dead letter arguments routing back to original queue • Now when `queue.one.dlx` message is rejected it will be moved back to queue `queue.one` • To automatically reject message after delay declare queue `queue.one.dlx` with argument `x-message-ttl`. As value use timeout in milliseconds
  • 23. Remote Procedure Call • Sometimes you need to wait for response • Useful for multiple (time consuming) calculations at same time • 10s and 15s calculations will last 15s instead of 25s
  • 24. Remote Procedure Call • RPC client (Publisher) • generates temporary queue • publishes message to RPC server’s exchange • with generated queue name in message header • starts consuming generated queue (timeout is recommended)
  • 25. Remote Procedure Call • RPC server (Consumer) • processes message from RPC client • publishes response to default exchange • using generated queue name from message header as routing key