SlideShare a Scribd company logo
2
Most read
3
Most read
21
Most read
Message Queues
The good, the bad…
Maksym Bodnar
maksym.bodnar@gmail.com
What is MQ?
• MQ (message queue) - is a system that allows two
or more processes to interact (communicate) via
data exchange:
• The code that sends a piece of data (message)
and the code that receives that piece of data
(message) do not interact directly and (should)
know nothing about each other.
• A message (usually) is NOT processed at the
moment when it is sent. Processing can happen
at any moment or can not happen at all.
• Edge case: RPC mode, when sender is waiting
(blocking the execution) until message is
processed.
Key elements: publisher
• Publisher (producer) - the app that generates messages
and pushes (publishes) them into an MQ.
Key elements: broker (exchange)
• Broker (exchange) - the main piece of the MQ
architecture, the app that decides how messages are
delivered to the consumer. It also provides persistency (if
needed), messages acknowledgement and re-delivery (if
needed) etc.
Key elements: consumer
• Consumer (subscriber) - the part of an app that receives a
message from the broker and processes it. Usually this
part of application is called “worker” - a script(s) that is
waiting for a new message to process.
Key terms: Blocking
Blocking means that the code execution is stopped (paused)
after making a call or request to a long running service until
the service returns a result.
Key terms: Non-blocking
Non-blocking execution means that code continues after
making a call or request to a long running service and does
not wait for the result or output.
Unblock your code
Unblock your code (cnt)
Key benefits of using MQ
• Non-blocking code;
• Parallel execution;
• Easy horizontal scaling;
• Use different programming languages;
• Application resilience;
• Easy requests throttling;
Loops decomposition (parallel execution)
Loops decomposition (parallel
execution)(cnt)
Dark side of the MQ
• Yet another beast in the zoo;
• Bottlenecks;
• Integrating with existing code is tricky;
• Concurrency issues;
• Self blocking queues;
• Testing and debugging pain;
• Monitoring and maintenance;
Pick your favorite bottleneck
• Network interfaces;
• CPU/memory load;
• DB;
• Filesystem;
• External services;
Integration (refactoring) can be challenging
Integration (refactoring) can be challenging
Key terms: Synchronous
Synchronous execution means execution in the same time
line, connected threads. In this case all code in all processes
is executed at the same speed and all processes are aware
of state of other processes.
Key terms: Asynchronous
Asynchronous execution means that all threads or processes
are executed independently with no specific order.
Concurrency problem
• Be aware of duplicated messages;
• Messages are processed in no particular order;
Concurrency problem
Debugging/testing challenges
• Automated integration tests are impossible and make little
sense;
• Response of local vs production environment under load is
different;
• Debugging is difficult - no united stack tracing available
(out of box).
Monitoring
• Flood detection (publish/confirm rate);
• Self-blocking queues;
• Implied Infinite loops;
• Messages that are causing exceptions in workers;
Thank you

More Related Content

PPTX
Multi threaded programming
PPTX
Os unit 3 , process management
PPT
Proxy Server
PPTX
Network software
PPTX
Load balancing in cloud
PPT
Firewalls
ODP
Introduction To RabbitMQ
PPTX
jstl ( jsp standard tag library )
Multi threaded programming
Os unit 3 , process management
Proxy Server
Network software
Load balancing in cloud
Firewalls
Introduction To RabbitMQ
jstl ( jsp standard tag library )

What's hot (20)

PDF
Process scheduling (CPU Scheduling)
PDF
Kernel security Concepts
PPTX
cpu scheduling
PPT
Distributed Deadlock Detection.ppt
PPT
Architecture of Linux
PPTX
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
PPT
Clock synchronization in distributed system
PPTX
ALOHA Protocol (in detail)
PPT
Name services
PPTX
CPU Scheduling in OS Presentation
PPTX
Linux file system
PPTX
RPC: Remote procedure call
PPTX
Virtualization in cloud computing
PPTX
Dead Lock in operating system
PPT
Deadlock
PDF
Stop and-wait protocol
PPTX
Frogger vlan hopping
PDF
Python3 (boto3) for aws
PPTX
System calls
PPSX
Issues in Data Link Layer
Process scheduling (CPU Scheduling)
Kernel security Concepts
cpu scheduling
Distributed Deadlock Detection.ppt
Architecture of Linux
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
Clock synchronization in distributed system
ALOHA Protocol (in detail)
Name services
CPU Scheduling in OS Presentation
Linux file system
RPC: Remote procedure call
Virtualization in cloud computing
Dead Lock in operating system
Deadlock
Stop and-wait protocol
Frogger vlan hopping
Python3 (boto3) for aws
System calls
Issues in Data Link Layer
Ad

Similar to Message queues (20)

PPT
Mq Lecture
PPTX
CST 402 Distributed Computing Module 1 Notes
PPT
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
PPTX
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
PPT
UNIT-1 Introduction to Distributed SystemPPT.ppt
PDF
[@NaukriEngineering] Messaging Queues
PPTX
Linux Inter Process Communication
PDF
Inter-Process Communication in distributed systems
PDF
Open source building blocks for the Internet of Things - Jfokus 2013
PPTX
Embtjhofigkjgzyuibchvjkheddejfjhgjhjgkmd system-3.pptx
PDF
DistributedOSintro.pdf from CSE Distributed operating system
PPTX
Introduction to Microservices Patterns
PPTX
Introduction to Microservices Patterns
PPTX
Lecture 3 Inter Process Communication.pptx
PDF
Enterprise Messaging with RabbitMQ.pdf
PPTX
Hyperledger Consensus Algorithms
PDF
Foundational Design Patterns for Multi-Purpose Applications
PPTX
OSI reference model
PPTX
Enterprise messaging with jms
PDF
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
Mq Lecture
CST 402 Distributed Computing Module 1 Notes
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
UNIT-1 Introduction to Distributed SystemPPT.ppt
[@NaukriEngineering] Messaging Queues
Linux Inter Process Communication
Inter-Process Communication in distributed systems
Open source building blocks for the Internet of Things - Jfokus 2013
Embtjhofigkjgzyuibchvjkheddejfjhgjhjgkmd system-3.pptx
DistributedOSintro.pdf from CSE Distributed operating system
Introduction to Microservices Patterns
Introduction to Microservices Patterns
Lecture 3 Inter Process Communication.pptx
Enterprise Messaging with RabbitMQ.pdf
Hyperledger Consensus Algorithms
Foundational Design Patterns for Multi-Purpose Applications
OSI reference model
Enterprise messaging with jms
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
Ad

Recently uploaded (20)

PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Website Design Services for Small Businesses.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
AutoCAD Professional Crack 2025 With License Key
PDF
Autodesk AutoCAD Crack Free Download 2025
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Advanced SystemCare Ultimate Crack + Portable (2025)
Website Design Services for Small Businesses.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Designing Intelligence for the Shop Floor.pdf
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
CHAPTER 2 - PM Management and IT Context
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Computer Software and OS of computer science of grade 11.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
Why Generative AI is the Future of Content, Code & Creativity?
wealthsignaloriginal-com-DS-text-... (1).pdf
Design an Analysis of Algorithms II-SECS-1021-03
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
AutoCAD Professional Crack 2025 With License Key
Autodesk AutoCAD Crack Free Download 2025

Message queues

  • 1. Message Queues The good, the bad… Maksym Bodnar maksym.bodnar@gmail.com
  • 2. What is MQ? • MQ (message queue) - is a system that allows two or more processes to interact (communicate) via data exchange: • The code that sends a piece of data (message) and the code that receives that piece of data (message) do not interact directly and (should) know nothing about each other. • A message (usually) is NOT processed at the moment when it is sent. Processing can happen at any moment or can not happen at all. • Edge case: RPC mode, when sender is waiting (blocking the execution) until message is processed.
  • 3. Key elements: publisher • Publisher (producer) - the app that generates messages and pushes (publishes) them into an MQ.
  • 4. Key elements: broker (exchange) • Broker (exchange) - the main piece of the MQ architecture, the app that decides how messages are delivered to the consumer. It also provides persistency (if needed), messages acknowledgement and re-delivery (if needed) etc.
  • 5. Key elements: consumer • Consumer (subscriber) - the part of an app that receives a message from the broker and processes it. Usually this part of application is called “worker” - a script(s) that is waiting for a new message to process.
  • 6. Key terms: Blocking Blocking means that the code execution is stopped (paused) after making a call or request to a long running service until the service returns a result.
  • 7. Key terms: Non-blocking Non-blocking execution means that code continues after making a call or request to a long running service and does not wait for the result or output.
  • 10. Key benefits of using MQ • Non-blocking code; • Parallel execution; • Easy horizontal scaling; • Use different programming languages; • Application resilience; • Easy requests throttling;
  • 13. Dark side of the MQ • Yet another beast in the zoo; • Bottlenecks; • Integrating with existing code is tricky; • Concurrency issues; • Self blocking queues; • Testing and debugging pain; • Monitoring and maintenance;
  • 14. Pick your favorite bottleneck • Network interfaces; • CPU/memory load; • DB; • Filesystem; • External services;
  • 17. Key terms: Synchronous Synchronous execution means execution in the same time line, connected threads. In this case all code in all processes is executed at the same speed and all processes are aware of state of other processes.
  • 18. Key terms: Asynchronous Asynchronous execution means that all threads or processes are executed independently with no specific order.
  • 19. Concurrency problem • Be aware of duplicated messages; • Messages are processed in no particular order;
  • 21. Debugging/testing challenges • Automated integration tests are impossible and make little sense; • Response of local vs production environment under load is different; • Debugging is difficult - no united stack tracing available (out of box).
  • 22. Monitoring • Flood detection (publish/confirm rate); • Self-blocking queues; • Implied Infinite loops; • Messages that are causing exceptions in workers;

Editor's Notes

  • #12: 100 orgs x 1000 users x 1s = 100 000 seconds = 28 hours
  • #13: 100 x 1000 x 0.001 = 100 s => 2 min 10 workers => 10 000 s => 3 hours 20 workers => 5 000 s => 1.5 hours
  • #16: Key problem here - slow blocking method returns result that is used later.
  • #17: DB transaction makes no sense when decomposing loop to MQ. Requires whole concept rethinking.
  • #20: idem·​po·​tent | \ ˈī-dəm-ˌpō-tᵊnt code in workers; Code: if each