Amazon Simple Queue Service (SQS) is a fully-managed message queuing service provided by AWS, enabling you to decouple and scale microservices, distributed systems, and serverless applications. With SQS, messages can be sent, stored, and received between software components at any scale without message loss. Standard queues provide maximum throughput, best-effort ordering, and at-least-once delivery. FIFO queues ensure that messages are processed exactly once, in the precise order they are sent.
SQS eliminates administrative overhead, ensures reliable message delivery, safeguards sensitive data, and scales elastically and cost-effectively.
Security, Durability, Availability, Scalability, Reliability, and Customization are key benefits of using SQS.
There are 2 types of SQS Queues on AWS:
- Standard Queue
- FIFO Queue
- Standard Queue: Supports a nearly unlimited number of transactions per second (TPS) per API action. A message is delivered at least once but may occasionally be delivered more than once. Messages might be delivered in a different order from which they were sent.
- FIFO Queue: Supports up to 3,000 messages per second (TPS) per API action. A message is delivered once and remains available until processed and deleted by the consumer. Message order is strictly preserved.
To learn more about SQS Queues, click here.
SQS charges you only for what you use, with no minimum fees. For AWS SQS pricing details, click here.
In this article, we will explore the steps to create both Standard and FIFO Queues, send messages to them, delete messages, and remove the Queues.
Pre-requisites
- AWS Account (Create if you don’t have one).
What will we do?
- Log in to AWS.
- Create SQS Queues and Send Messages
- View and delete Messages from the queues
- Delete the Queues
Log in to AWS
- Log in to AWS using your credentials.
After logging in, you’ll see the AWS Management Console with a list of all services.
Create SQS Queues
Click on “Services” at the top left, search for “SQS”, and click on “Simple Queue Service”.
You will see the Main Page. Click on “Get started Queue”.
On the “Create New Queue” page, give a name to the Standard Queue and scroll down.
After naming the Standard Queue, click on the “Create Queue” button at the bottom left.
Once the Standard Queue is created, select the Queue and click on “Queue Actions” and “Send a Message”.
Type a message that you want to send and click on the “Send Message” button.
You’ll be prompted to send another message or click “Close”.
To create a FIFO Queue, select “FIFO Queue” and provide a name. After naming the FIFO Queue, scroll down.
Click on “Quick-Create Queue”.
Once the FIFO Queue is created, select the Queue and click on “Queue Actions” and “Send a Message”.
Enter the message you want to send to the FIFO Queue, provide a Message Group ID and Message Duplication ID, and click “Send Message”.
You can choose to send another message or click “Close”.
View and Delete Messages from the Queue
Select the Queue name from which you want to read the messages sent in the steps above.
Using the Standard Queue, click “Quick Actions” -> “View/Delete Messages”.
Click “Start Polling for Messages”.
You will see the message sent in the previous step. To delete it, select the message and click “Delete 1 Message”.
In the confirmation box, click “Yes, Delete Checked Messages” to complete the deletion.
Similarly, view or delete messages sent to a FIFO Queue. Select the FIFO queue, click “Quick Actions” -> “View/Delete Messages”.
Click “Start Polling for Messages” to view the messages sent earlier.
Select the message you wish to delete and click “Delete 1 Message”.
Confirm by clicking “Yes, Delete Checked Message”.
Delete Queues
Select the Queues for deletion, click “Quick Actions” and “Delete Queues”.
On the confirmation page, click “Yes, Delete 2 Queues”.
Conclusion
In this article, we explored how to create Standard and FIFO queues, send and manage messages, and delete queues using AWS SQS.
Frequently Asked Questions
What is Amazon SQS?
Amazon SQS is a simple, scalable, fully-managed message queuing service that allows applications to communicate via messages asynchronously.
What are the types of queues in AWS SQS?
There are two types of queues in AWS SQS: Standard Queue and FIFO Queue.
How is FIFO different from Standard Queue?
FIFO queues deliver messages in the exact order they are sent and ensure that each message is processed exactly once, while Standard queues provide best-effort ordering and at-least-once delivery.
Is there a minimum charge for using SQS?
No, SQS charges only based on usage with no minimum fees.
Where can I find more information about AWS SQS pricing?
More information on AWS SQS pricing can be found here.