Get more updates and further details about your project right in your mailbox.
The best time to establish protocols with your clients is when you onboard them.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.
Amazon Simple Queue Service is a message queue used by distributed applications to exchange messages through a polling model, and can be used to decouple sending and receiving components.
In modern world of frameworks and micro-service architecture the elimination of dependency is very important since if two services are dependent on each other. If one service fails then the other might lose the effective data. In order to eliminate these dependencies and to provide an assured service, SQS was brought into picture. There are plenty of other use cases too but this is the core purpose of SQS.
There are two different types of queues provided by SQS service and both have their own functionalities and different pricing.
The major difference between them is that the Standard queue handles the messages( data that we send ) in a random way and allows duplicate messages to hold inside the queue, While the FIFO queue allows the message as a proper queue: first message that comes in gets served out first. Also FIFO will not allow duplicate messages inside the queue.
Pricing difference: For both the queues First 1 Million Requests/Month is Free. After the 1 Million Request the Standard queue costs $0.40 for the next 1 Million to 100 Billion Requests and the FIFO queue costs $0.50 for the next 1 Million to 100 Billion Requests. When the number of request is increases then the pricing range will also increase.
Courtesy to AWS
The reason why FIFO queue costs more is because of extra services provided by AWS like FIFO order and the de-duplication provided by the AWS.
Now lets see in depth about how we can create a simple queue through the AWS console and what are the available configurations in AWS.
I have chosen all the default values and have not altered any configurations.
The Re-drive allow policy will help you to redirect the data in the Dead Letter Queue to your actual queue. It can be enabled by enabling the Re-drive allow policy and choosing the dead letter queue ARN. Let’s deal with the dead letter queue in the next article. I have disabled Re-drive allow policy.
You can set up a Dead Letter Queue which helps in storing the messages that were crashed while processing / failed to process a proper outcome. Lets discuss about the Dead Letter Queue in detail in the next article, I have disabled the Dead Letter Queue.
To organize and identify your Amazon SQS queues for cost allocation, you can add metadata tags that identify a queue’s purpose, owner, or environment. This is especially useful when you have many queues. It is optional and is not mostly required for most of the cases.
Now click the Create queue button to create the queue and Let’s start sending and receiving messages.
As you can see the queue has been created. Now click the queue name and click the send and receive message button.
Here you can pass a payload / message through the console and you can delay the delivery of the messages to the queue by mentioning the duration in the delivery delay field.
Also you can add message attributes to the messages. Message attributes are structured metadata (such as timestamps, signatures, and identifiers) that are sent with the message.
After sending the message you will get a success pop up and you can review the message details and its id and other attributes of the message by clicking view details.
In receive message division you can see the available messages in the queue and you can poll the messages out of the queue and view the messages.
Click the ‘Poll for messages’ to receive the messages. You can also configure the number of messages to be polled out of the queue and the poll duration.
As you can see that the message that we sent is now viewable. ( Note : the receive count here states that the no of times the message has been polled out of the queue and was made available to the consumer). You can click the ID and check the message details.
And with that we have covered the basics of how SQS can be configured. I would advice you guys to play with these configurations to get an in-depth knowledge about these configurations. My next article would cover how we can setup this queue as a trigger for a lambda function.