0% found this document useful (0 votes)
12 views10 pages

System Admin Report

The document provides an overview of message queuing, defining it as a method for asynchronous communication between services in serverless and microservices architectures. It discusses the benefits, types, and operational steps of message queues, highlighting their role in improving performance, reliability, and scalability. Additionally, it outlines use cases such as email communication and data post-processing, emphasizing the importance of message queues in modern distributed systems.

Uploaded by

print Qaraxi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views10 pages

System Admin Report

The document provides an overview of message queuing, defining it as a method for asynchronous communication between services in serverless and microservices architectures. It discusses the benefits, types, and operational steps of message queues, highlighting their role in improving performance, reliability, and scalability. Additionally, it outlines use cases such as email communication and data post-processing, emphasizing the importance of message queues in modern distributed systems.

Uploaded by

print Qaraxi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Ministry of Higher Education and Scientific

Research

Sulaimani Polytechnic University


Technical College of Informatics
Department of Computer Networks
2024-2025

Message Queuing

Prepared by :
Hiran Bakhtyar
Helin Tahir
Gona Soran
Shniar Mariwan

Supervised by:
Dr. Zryan Rashid

1
Introduction

What is message Queue?

Queue : in this context could be define as a list of data items, commands, or


task, stored so as to be retrieve in a specific order, usually the order of
insertion.

Message: on the other hand, is data transported between a sender and a


receiver (an e.g could be messages you sent to your friends on either
whatsApp or facebook messenger). But, in the context of our discussion the
best definition we could give a message should be something that tells a
system to start processing a particular task, it could contain information about
a finished task or just a simple message of a completed task.

Message Queue : A message queue is a form of asynchronous service-to-


service communication used in serverless and microservices architectures.
Messages are stored on the queue until they are processed and deleted. Each
message is processed only once, by a single consumer. Message queues can
be used to decouple heavyweight processing, to buffer or batch work, and to
smooth spiky workloads.

https://medium.com/@mosesbasseyekwere/message-queue-what-it-is-how-it-works-and-when-to-
use-it-2b7fb5dcef48

https://aws.amazon.com/message-queue/#:~:text=Message%20Queues&text=A%20message
%20queue%20is%20a,once%2C%20by%20a%20single%20consumer.

2
Benefits of Message Queuing
1. Better Performance: Message queues enable asynchronous
communication, which means that the endpoints that are producing and
consuming messages interact with the queue, not each other. Producers
can add requests to the queue without waiting for them to be processed.
Consumers process messages only when they are available. No component
in the system is ever stalled waiting for another, optimizing data flow.
2. Increased Reliability: Queues make your data persistent, and reduce the
errors that happen when different parts of your system go offline. By
separating different components with message queues, you create more
fault tolerance. If one part of the system is ever unreachable, the other can
still continue to interact with the queue. The queue itself can also be
mirrored for even more availability.
3. Granular Scalability: Message queues make it possible to scale precisely
where you need to. When workloads peak, multiple instances of your
application can all add requests to the queue without risk of collision. As
your queues get longer with these incoming requests, you can distribute
the workload across a fleet of consumers. Producers, consumers and the
queue itself can all grow and shrink on demand.
4. Simplifed Decoupling: Message queues remove dependencies between
components and significantly simplify the coding of decoupled
applications. Software components aren’t weighed down with
communications code and can instead be designed to perform a discrete
business function.
https://aws.amazon.com/message-queue/benefits/

3
Types of message queues :

 Workstation message: queues are used for sending and receiving


messages between workstation users and between workstation users
and the system operator. The name of the queue is the same as the
name of the workstation. The queue is created by the system when the
workstation is described to the system.
 User profile message queues: can be used for communication
between users. User profile message queues are automatically created
in library QUSRSYS when the user profile is created.
 Job message queues: are used for receiving requests to be processed
(such as commands) and for sending messages that result from
processing the requests; the messages are sent to the requester of the
job. Job message queues exist for each job and only exist for the life of
the job. Job message queues consist of an external message queue
(*EXT) and a set of call stack entry message queues.
 System operator message queue: (QSYSOPR) is used for receiving
and replying to messages from the system, display station users, and
application programs.
 The history log message queue: is used for any job in the system to
have a record of high-level system activities.
https://www.ibm.com/docs/en/i/7.3?topic=queues-types-message

4
How Message Queues Works?

 Step 1: Sending Messages: The message producer creates a


message and sends it to the message queue. The message typically
contains data or instructions that need to be processed or
communicated.
 Step 2: Queuing Messages: The message queue stores the
message temporarily, making available for one or more
consumers. Messages are typically stored in a first-in, first out
(FIFO) order.
 Step 3: Consuming Messages: Message consumers retrieve
messages from the queue when they are ready to process them.
They can do this at their own pace, which enables asynchronous
communication.
 Step 4: Acknowledgment (Optional): In some message queue
systems, consumers can send acknowledgments back to the queue,
indicating that they have successfully processed a message. This is
essential for ensuring message delivery and preventing message
loss.
https://www.geeksforgeeks.org/message-queues-system-design/#how-
message-queue-work

5
Topology Designs in Message Queuing
These are some topology designs in message queuing System:

1. Point-To-Point Messaging
Point to Point means message(s) is sent from one application(producer/
sender) to another application(consumer/receiver) via a queue. There
can be more than one consumer listening on a queue but only one of
them will be ale to get the message. Hence, it is Point to Point or One to
One.

2. Priority Queue Pattern


The Priority Queue pattern is a pattern that allows us to prioritize
requests sent to services so that higher priority requests are received
and processed faster than lower priority requests.This is useful for
when we are building applications where we need to prioritize some
clients over others, or if some requests need to be processed faster than
usual for business/compliance reasons.

3. Dead Letter Queue

A dead-letter queue (DLQ) is a special type of message queue that


temporarily stores messages that a software system cannot process due
to errors. Message queues are software components that support
asynchronous communication in a distributed system. They let you
send messages between software services at any volume and don’t
require the message receiver to always be available. A dead-letter
queue specifically stores erroneous messages that have no destination
or which can’t be processed by the intended receiver.

https://medium.com/tech-sauce/introduction-to-message-queuing-4a7ab8968b59
https://aws.amazon.com/what-is/dead-letter-queue/
https://dev.to/willvelida/the-priority-queue-pattern-23g8

6
What are the use cases of message queues?
Message queues are not for real-time communications. You can't use them
when you want an immediate response: for instance, in an HTTP request where
the end user shouldn’t wait for the response. In reality, message queues are
suitable for processes that aren't crucial.

You may need a message queue when:

 Getting timeout errors due to too many simultaneous requests.


 Needing a decoupled way to communicate between applications.
 Needing to scale down or up during peak hours.

Two real-world use cases of message queues are given below.

Email communication

We all use emails for several purposes, including marketing campaigns,


password resets, account verification, etc. Many of these use cases don't need
immediate processing, meaning delays in their dispatch are acceptable. Delays
in email dispatching do not affect the functionality of applications using emails
for less critical use cases. Message queues can help where applications need to
process both urgent and non-urgent emails simultaneously.

You can see an email queue as a buffer where the emails are stored before they
hit the endpoint. At the same time, the sender does not need to send each
message separately. The communication between the sender and the recipient is
asynchronous. Once the emails have been queued, they’re delivered step by
step. Usually, the Simple Mail Transfer Protocol (SMTP) server starts from the
beginning of the queue and goes forward.

7
Data post-processing
The second use case for message queues is data post-processing. Here’s an
example that can illustrate how message queues can help: Let’s say you have a
blog application that has to process image data from the images uploaded by
users. Since users can't offer web-optimized or suitable-sized images, adding a
post-process and resizing image function won't affect the application
functionality much. This isn't a critical operation and doesn’t require immediate
action. A service is employed in the application architecture that can optimize
images uploaded by the application. In this scenario, a message queue can help to
transmit messages between the application and service, facilitating image
optimization.

https://www.contrastsecurity.com/security-influencers/what-is-a-message-queue-
importance-use-cases-and-vulnerabilities-contrast-security

8
Conclusion

Message queues are indispensable tools in modern distributed systems,


enabling reliable, scalable, and efficient communication between services.
They decouple producers and consumers, ensuring flexibility and fault
tolerance in application architectures. By employing message queues,
organizations can handle spikes in workload, improve performance, and ensure
data consistency even in the face of system failures.

With various types and patterns, such as point-to-point messaging, priority


queues, and dead-letter queues, message queues offer tailored solutions for
diverse use cases like email communication and data post-processing. By
leveraging these powerful tools, developers can build robust applications that
adapt to changing demands while simplifying the complexities of system
interactions.

Message queues are not just about transferring data—they represent a


paradigm shift in how we design and manage applications, making them a
critical component in the journey toward efficient, resilient, and scalable
system architectures.

By integrating message queues effectively, businesses and developers can


unlock the full potential of their systems, ensuring seamless operations and a
competitive edge in the digital landscape.

9
References
 https://medium.com/@mosesbasseyekwere/message-queue-what-it-is-
how-it-works-and-when-to-use-it-2b7fb5dcef48
 https://aws.amazon.com/message-queue/#:~:text=Message
%20Queues&text=A%20message%20queue%20is%20a,once%2C
%20by%20a%20single%20consumer.

 https://aws.amazon.com/message-queue/benefits/
 https://www.ibm.com/docs/en/i/7.3?topic=queues-types-message
 https://www.geeksforgeeks.org/message-queues-system-design/#how-
message-queue-work
 https://medium.com/tech-sauce/introduction-to-message-queuing-
4a7ab8968b59
 https://aws.amazon.com/what-is/dead-letter-queue/
 https://dev.to/willvelida/the-priority-queue-pattern-23g8
 https://www.contrastsecurity.com/security-influencers/what-is-a-
message-queue-importance-use-cases-and-vulnerabilities-contrast-
security

10

You might also like