Simple Queue Service (SQS) | Amazon

  • Post category:Solutions
  • Reading time:4 mins read

SNS

Simple Queue Service (SQS) offers engineers an easy way to build queuing services for their applications. SQS is a fully managed message queueing service, so you don’t have to worry about scaling your servers or configuring them correctly. It’s designed to be fault-tolerant with no single point of failure, so it will keep running even if other parts of AWS are disrupted. You can either create queues yourself or use one of the preconfigured templates which come with SQA support already configured out-of-the-box. There are many different types of messages that can be sent: text messages, images, video streams – anything!

What is Amazon Simple Queue Service (SQS)?

  • Amazon Simple Queue Service (SQS) is a service that does not require any administrative overhead and can handle billions of messages per day.
  • This tool is designed to store all messages in a single, highly available AWS Region. No matter what happens with your computer or network connection, you can still read and send out messages from this program.
  • Amazon Simple Queue Services (or just “Amazon SQS”) manages very complex operations like sending items, registering them into queues with specific parameters set by their creators; but also allows users who don’t have access

Amazon Simple Queue Service (SQS) Features

  1. Dead letter queues (DLQs) are collections of messages that could not process and receive them like any other SQS queue. Anyone can create a DLQ from the API or console to send, retrieve, edit requests in order for these queues to work even better.
  2. Visibility timeout is when a message is “invisible” to the rest of your application after an application component gets it from the queue. During the visibility timeout, the part that received the message usually processes it and then deletes it from the line. This prevents multiple components from processing the same directive. During the application processing, if processing takes longer than expected, can modified the request.
  3. Messages in your Amazon SQS queues can be query by long polling. The default of short polling returns immediately, even if the message queue checked is empty. When dealing with long polls, will bear no response until a new message appears in the column or the voting runs out. Messages are retrieved as soon as they become available in the Amazon SQS queues

Here comes SQS

  • Sign in to AWS Management Console as a Root user
  • In the search bar type “SQS
  • The dashboard will appear and click on Create queue
  • So, when we create a queue in SQS we have 2 choices of Standard and FIFO
  • or now, we will go with Standard queue
  • We will give it a name as “DemoQueue”
  • Scroll down and you will see a lot of parameters but for now, we leave all the options as default

  • In Access policy, we define who can access our queue
  • By default, only the queue owner can send messages to the queue and receive messages from the queue
  • We can explore more options from the drop-down if we are doing some integration with Amazon S3 or Amazon SNS
  • For now, we will keep it only to the queue owner
  • There is a JSON policy attached which also looks like an S3 bucket policy

  • For Encryption Amazon SQS provides in-transit encryption by default but you can add at rest encryption by enabling it
  • Click on Enabled
  • In the Customer master key choose Default CMK

Simple Queue Service (SQS)

  • Click on Create queue
  • Our DemoQueue is successfully created and we can send and receive messages now
  • Now we will go to the top right and click on Send and Receive messages

  • You will see 0 messages available in Received because we haven’t sent any message for now
  • So, in the message body, we will write hello world! and click on Send message

  • Below you will see in Received Messages as Messages available as 1
  • As soon as we click on Poll for messages the messages will appear

  • Below if you click on the message-id you will see some details of metadata like sender id and count of the messages
  • If you click on Body the message will appear

  • So, if you again click on Poll for messages the received count will be increased which means it has been read again
  • Now select the message and we will delete the message from our queue
  • Now there are 0 messages available in the queue and if we poll again we will not receive the same message because it is deleted
  • So, you can send messages by SQS many times and play with it and we have seen the powers of producers and consumers
  • To delete all the messages in the queue just click on Purge and it will delete all the messages

Check our other blogs to learn more about Amazon AWS. See you in the next blog.

Leave a Reply