<?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 Adel Saleh on Medium]]></title>
        <description><![CDATA[Stories by Adel Saleh on Medium]]></description>
        <link>https://medium.com/@Adel_Saleh?source=rss-ec6db900ec66------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FTepTErSwVBGRtZfSIKXJQ.jpeg</url>
            <title>Stories by Adel Saleh on Medium</title>
            <link>https://medium.com/@Adel_Saleh?source=rss-ec6db900ec66------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:30:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Adel_Saleh/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[Using SQS with Shoryuken in Rails (basics)]]></title>
            <link>https://medium.com/codex/using-sqs-with-shoryuken-in-rails-basics-78ab87cd8734?source=rss-ec6db900ec66------2</link>
            <guid isPermaLink="false">https://medium.com/p/78ab87cd8734</guid>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[sqs]]></category>
            <category><![CDATA[background-jobs]]></category>
            <category><![CDATA[shoryuken]]></category>
            <dc:creator><![CDATA[Adel Saleh]]></dc:creator>
            <pubDate>Fri, 17 Jun 2022 07:31:07 GMT</pubDate>
            <atom:updated>2022-06-22T13:11:12.485Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2PCTauFkJnWvPS3nMr2m6w.png" /></figure><p>Background jobs is the processes that run in the background without affecting the normal operations in the system, and return a quick response to the user, it’s used to reduce the manual effort and to automate the process.</p><blockquote>One of best ways to Setting up queueing for background jobs is Amazon Simple Queue Service (SQS) it’s is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. read more about <strong>Benefits in : </strong><a href="https://aws.amazon.com/sqs/">https://aws.amazon.com/sqs/</a></blockquote><p>Shoryuken is ruby gem that help us to work easily with SQS, and it is a super-efficient <a href="https://aws.amazon.com/sqs/">Amazon SQS</a> thread-based message processor, support for continuously polling and thread based processing.</p><p><strong>let’s Getting started</strong></p><p>Firstly we need to add those gems to gem file and run the bundle install :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJ5AihImcBvp1P5jFmmD7w.png" /></figure><p><strong>SetUp the Shoryuken configuration</strong></p><p>Either you can specify Shoryuken.sqs_client with credentials in initializers like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GnQZeEy9VQVRpsjKFlt_wQ.png" /></figure><p>Or Define it in shoryuken.yml file like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KvrvsaiNyqZFbZk3dpVoRg.png" /></figure><p>Now let’s define our worker like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NDGksPDiH6gm3Ll5gljSEw.png" /></figure><p>and make sure queue name same like queue name in AWS or you can add it by Shoryuken : <a href="https://github.com/ruby-shoryuken/shoryuken/wiki/Multiple-ways-of-configuring-queues-in-Shoryuken">configuring-queues-in-Shoryuken</a> .</p><p>Now we can call our worker and Enqueue a message and send it to SQS like this HelloWorker.perform_async(&#39;test sqs&#39;)</p><figure><img alt="HelloWorker.perform_async(‘test sqs’)`" src="https://cdn-images-1.medium.com/max/1024/1*OaL03ZvaU6kElQLOL_I9Rg.png" /><figcaption><strong>HelloWorker.perform_async(‘test sqs’)</strong></figcaption></figure><p>Or if we need add delay to run the worker we can use like this :</p><p>HelloWorker.perform_in(interval(delay_seconds), &#39;test sqs&#39;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8OSlPV3ar_sCQkpGM9TVSw.png" /><figcaption><strong>HelloWorker</strong>.perform_in(<strong>3</strong>, <strong>‘</strong>test sqs<strong>’</strong>)</figcaption></figure><p><strong>Start Shoryuken</strong></p><p>shoryuken -q queue_name_in_aws -R</p><p>read more for options in : <a href="https://github.com/ruby-shoryuken/shoryuken/wiki/Shoryuken-options">Shoryuken-options</a></p><blockquote>By running the shoryuken it will consuming and receiving the messages from SQS and start process them by calling the perform method and passing the sqs_msg and body.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-_9YW2KgBsh63Lvzaq5vRw.png" /></figure><p>That’s it 🤷‍♂️ , you can go deep in references and shoryuken <a href="https://github.com/ruby-shoryuken/shoryuken">gem</a> and customize it with your needed .</p><p><em>I hope this article helpful to start with SQS. Have a nice day</em> ☀️.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78ab87cd8734" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/using-sqs-with-shoryuken-in-rails-basics-78ab87cd8734">Using SQS with Shoryuken in Rails (basics)</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>