Amazon Simple Queue Service (SQS) is a managed message queuing service of AWS which enables us to decouple and scale microservices, distributed systems, and serverless applications. Using SQS, we can send, store, and receive messages between software components at any volume, without losing messages. Standard queues offer maximum throughput, best-effort ordering, and at least-once delivery. FIFO queues are designed to guarantee that messages are processed exactly once, in the exact order that they are sent.

SQS Eliminates administrative overhead, provides Reliably delivery of messages, keeps sensitive data secure, and scales elastically and cost-effectively.

Security, Durability, Availability, Scalability, Reliability, Customization are a few of the benefits of using SQS.

There are 2 types of SQS Queues on AWS.

  1. Standard Queue
  2. FIFO Queue
  1. Standard Queue:

    Supports a nearly unlimited number of transactions per second (TPS) per API actionA message is delivered at least once, but occasionally more than one copy of a message is delivered. Occasionally, messages might be delivered in an order different from which they were sent.
  2. FIFO Queue:

    FIFO queues support up to 3,000 messages per second (TPS), per API actionA message is delivered once and remains available until a consumer processes and deletes itThe order in which messages are sent and received is strictly preserved.

To know more about the SQS Queues, click here.

For SQS we pay only for what we use, there is no minimum fee. To know more about the pricing of AWS SQS click here

In this article, we will see the steps to create a Standard and FIFO Queue, send messages to them, delete messages and delete Queues.

Pre-requisites

  1. AWS Account (Create if you don’t have one). 

What will we do?

  1. Login to AWS.
  2. Create SQS Queues and Send Message
  3. View and delete Messages from the queues
  4. Delete the Queues

Login to AWS

  1. Click here to go to AWS Login Page.

When we hit the above link, we will see a web page as follows where we are required to login using our login details.

<img alt="Login to AWS" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.36_.26_PM_.png6194d09f81baf.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Once we login into AWS successfully, we will see the main console with all the services listed.

<img alt="AWS Management Console" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.36_.52_PM_.png6194d09fb2340.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Create SQS Queues

Click on “Services” in the top left and search for “SQS” and click on “Simple Queue Service”.

<img alt="Create SQS Queue" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.36_.59_PM_.png6194d09fd2c34.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

You will see the Main Page, here click on “Get started Queue”.

<img alt="Simple Queue Service" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.41_.47_PM_.png6194d0a005da2.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

On the “Create New Queue” page, give a name to Standard Queue and scroll down the page.

<img alt="Set Queue name" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.41_.59_PM_.png6194d0a03a7c8.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

After giving a name to the Standard Queue, click on “Create Queue” button in the bottom left.

<img alt="Resource Groups" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.42_.34_PM_.png6194d0a0677d9.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Once the Standar Queue gets created, select the Queue and click on “Queue Actions” and “Send a Message”.

<img alt="Send a Message" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.42_.52_PM_.png6194d0a09b044.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Type a message that you want to send and click on the “Send Message” button.

<img alt="Message Body" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.43_.12_PM_.png6194d0a0cd015.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

You will get the following screen where you will be asked to send another message, send another message or click on “Close”.

<img alt="Test Message Queue" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.43_.15_PM_.png6194d0a0f28fb.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

To create a FIFO Queue, select “FIFO Queue” and give a name to it. After giving a name to the FIFO Queue, scroll down the page.

<img alt="Create FIFO Queue" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.43_.34_PM_.png6194d0a11ff33.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Here, click on “Quick- Create Queue”.

<img alt="FIFO Queue resource group" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.43_.37_PM_.png6194d0a144732.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Once the FIFO Queue gets created, select the Queue and click on “Queue Actions” and “Send a Message”.

<img alt="Send a message to FIFO Queue" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.43_.43_PM_.png6194d0a1787f9.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Here, type a message that you want to send to the FIFO Queue and give Message Group ID and Message Duplication ID and click on “Send Message”.

<img alt="Message body content" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.43_.53_PM_.png6194d0a1ad1c6.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Here also, you will get the following screen where you will be asked to send another message, send another message or click on “Close”.

<img alt="Test success" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.43_.57_PM_.png6194d0a1c7c35.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

View and Delete Message from the Queue

Select the Queue Name from which you want to read the message sent in the above steps.

I have selected the Standard Queue here, click on “Quick Actions” -> View/Delete Messages.

<img alt="View Delete Messages" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.44_.08_PM_.png6194d0a206614.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Here, click on “Start Polling for Messages”.

<img alt="Poll Messages" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.44_.10_PM_.png6194d0a230525.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Now, you can see the message that you sent in the previous step.

To delete the same, select the message and click “Delete 1 Message”.

<img alt="Remove message from queue" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.44_.15_PM_.png6194d0a252c6f.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

In the confirmation box, click on “Yes, Delete Checked Messages” to delete the selected message/s.

<img alt="Delete Checked Messages" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.44_.32_PM_.png6194d0a286f7a.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

In the same way, you can view/delete messages sent to FIFO Queue. Select the FIFO queue, click on “Quick Actions” -> “View/Delete Messages”.

<img alt="View Deleted Messages" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.45_.16_PM_.png6194d0a2a4274.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Here, click on “Start Polling for Messages” to view the messages sent in the previous step.

<img alt="Message Body details" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.45_.20_PM_.png6194d0a2d97cc.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Once you get a list of message/s, select that particular message to delete it and click on “Delete 1 Message”.

<img alt="Stop queue now" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.45_.26_PM_.png6194d0a315111.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

In the confirmation box, click on “Yes, Delete Checked Message”.

<img alt="Delete Checked message" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.45_.29_PM_.png6194d0a34535f.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Delete Queues

You can delete Queues by selecting them, click on “Quick Actions” and “Delete Queues”.

<img alt="Delete SQL Queue" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.45_.47_PM_.png6194d0a38345a.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

On the confirmation page, click on “yes, Delete 2 Queus.”

<img alt="Continue Deleting queues" data-ezsrc="https://kirelos.com/wp-content/uploads/2021/11/echo/Screenshot_2020-02-27_at_9.45_.50_PM_.png6194d0a3ac520.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="469" loading="lazy" src="data:image/svg xml,” width=”750″>

Conclusion

In this article, we saw the steps to create standard and FIFO queues, send messages to them, read them and delete the same. We also saw the steps to delete the Queues.