<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Simge Sarıçayır on Medium]]></title>
        <description><![CDATA[Stories by Simge Sarıçayır on Medium]]></description>
        <link>https://medium.com/@simge.saricayir?source=rss-21c6f3dcca31------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hB6IYJi6l2ZQuN3nogizug.jpeg</url>
            <title>Stories by Simge Sarıçayır on Medium</title>
            <link>https://medium.com/@simge.saricayir?source=rss-21c6f3dcca31------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:39:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@simge.saricayir/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding Message Queues and Brokers: When to Use What?]]></title>
            <link>https://medium.com/@simge.saricayir/understanding-message-queues-and-brokers-when-to-use-what-73d0817e7225?source=rss-21c6f3dcca31------2</link>
            <guid isPermaLink="false">https://medium.com/p/73d0817e7225</guid>
            <category><![CDATA[message-queue]]></category>
            <category><![CDATA[asynchronous-programming]]></category>
            <category><![CDATA[message-broker]]></category>
            <category><![CDATA[messaging]]></category>
            <dc:creator><![CDATA[Simge Sarıçayır]]></dc:creator>
            <pubDate>Sun, 15 Dec 2024 18:16:20 GMT</pubDate>
            <atom:updated>2024-12-15T18:17:12.582Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>What are you gonna find in this article?</strong></blockquote><p>In my first article on this blog, I would like to give you information about message queues and message brokers based on my research and some of my usage experiences, and to create ideas for you to use the right tool in your projects. I hope it will be a useful read.</p><blockquote><strong>What are message queues and message brokers?</strong></blockquote><p><strong>A message queue</strong> is a software component that enables asynchronous communication between systems or components by storing and managing messages until they are processed. Examples: Amazon SQS, ActiveMQ (in basic mode).</p><p><strong>A message broker</strong> is a software component or middleware that facilitates communication by routing, transforming, and delivering messages between producers and consumers. Message brokers may manage queues, topics, or other message delivery mechanisms to facilitate communication. Examples: RabbitMQ, Apache Kafka, Azure Service Bus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnzP2K56KESmKfU1kk12IA.png" /></figure><p><strong><em>Producer</em></strong><em> adds a message to queue to store until consumer gets the message.</em></p><p><strong><em>Consumer</em></strong><em> retrieves message from the queue which is sent by the producer.</em></p><blockquote><strong>Why a message broker should use?</strong></blockquote><p>Message brokers hold significant importance in system design for several reasons:</p><ul><li><strong>Decoupling:</strong> A message broker decouples the sender and receiver. They operate independently so it provides flexible architecture.</li><li><strong>Asynchronous Communication: </strong>With message queues there is no need to wait for a response. Tasks can run independently and asynchronously, improving system responsiveness and flexibility.</li><li><strong>Scalability:</strong> Producers and consumers work independently and it provides system a chance to handle traffic efficiently.</li><li><strong>Resilience: </strong>Message brokers improve fault tolerance with retry mechanisms. If a process fails, messages can be retried until they succeed, enhancing the system’s recoverability and reliability.</li></ul><blockquote><strong>Message Queue Types</strong></blockquote><ul><li><strong>Point-to-Point (P2P) Queue</strong></li></ul><p>In this model, messages are sent from a producer to a specific consumer via a queue. Each message is delivered to <strong>only one consumer</strong>, ensuring that it is processed once. This model is commonly used in task processing systems, where each task (message) needs to be handled by a single worker (consumer).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmyD-uatP1Rp5cyXff-DJg.png" /></figure><ul><li><strong>Publish/Subscribe (Pub/Sub) Queue</strong></li></ul><p>Unlike message queues, in the pub/sub model, messages are sent by publishers (producers) to a topic without needing to know about the subscribers (consumers). Subscribers subscribe to the topic and receive messages published to it. In this model, there can be multiple publishers sending messages to the same topic, and multiple subscribers receiving the same message concurrently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v7v60CPIcSpN2ENFx9CrUQ.png" /></figure><ul><li><strong>Priority Queue</strong></li></ul><p>When a publisher sends a message to a queue, it can assign a priority value to that message. Unlike classic FIFO queues, when message is arrived to a priority queue, queue manager reorders messages based on their priority values. Higher priority messages arrive at the consumer before lower-priority ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhlaoICqeKHmj0Yn0ZEvmw.png" /></figure><ul><li><strong>Dead Letter Queue (DLQ)</strong></li></ul><p>A Dead Letter Queue is useful for system recovery when a message cannot be successfully processed by a consumer. This can occur in scenarios such as the consumer being unavailable, message processing failures, or network-related issues that corrupt the message. In such cases, the DLQ acts as a designated queue to store these problematic messages. This allows them to be reviewed, reprocessed later, or analyzed to identify and resolve the underlying issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTyqCuWa3fed0_AaxlMn8w.png" /></figure><blockquote><strong>Comparison- Which message queue is suitable for your system?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9PRLBQu_k-4G4H_uKxvyQ.png" /></figure><blockquote><strong>Real Life Examples</strong></blockquote><ul><li><strong>Long-running tasks</strong>: When a file processing task takes a long time and the user who sends the request does not need to know the result immediately, the request can be processed asynchronously within a queue.</li><li><strong>Log collecting</strong>: In a large system, logs are generated by many producers. These logs can be placed in a queue, allowing the log processing system to handle the traffic efficiently and asynchronously.</li><li><strong>Notification systems</strong>: Most applications include notification systems. When a system needs to send notifications to users, it places the messages in a queue to be sent asynchronously. This allows the system to efficiently handle a high volume of notifications without affecting overall performance.</li></ul><blockquote><strong>Conclusion</strong></blockquote><p>As a result, messaging systems are widely usable for different architectural systems. Choosing the right messaging solution based on the specific needs of the system and project enhances architectural efficiency and overall performance.</p><blockquote><strong>References</strong></blockquote><ul><li><a href="https://www.rabbitmq.com/">https://www.rabbitmq.com/</a></li><li><a href="https://redis.io/glossary/pub-sub/#:~:text=Redis%20provides%20a%20publish%2Fsubscribe,are%20published%20to%20those%20channels">https://redis.io/glossary/pub-sub/#:~:text=Redis%20provides%20a%20publish%2Fsubscribe,are%20published%20to%20those%20channels</a>.</li><li><a href="https://better.engineering/message-queues/">https://better.engineering/message-queues/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73d0817e7225" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>