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.
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;
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.
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;