Simple Demo of AWS- SQS and Python- Boto3



This video shows how you can access the AWS-SQS service from Python through the Boto3 library. You can create a queue, then write to the queue and receive from the queue. Each message is guaranteed to be deleted once (though can be received multiple times after each visibility timeout window, if the message has not been deleted by the initial recipient). My code demos a delete after each read-receipt (but this can be easily modified to see what happens if no delete happens on each read) . You’ll notice that without an explicit message delete, the message is simply invisible on the default visibility-timeout window of 30 seconds, and re-appears 30 seconds later with a different receipt-handler.

https://markcodebucket.s3-us-west-1.amazonaws.com/pythonsqsdemo.py

My code demos how to delete a message as well, specifying the ReceiptHandler of the message as well as Queue-Url at time of delete.

source

5 thoughts on “Simple Demo of AWS- SQS and Python- Boto3”
  1. Hi I have one requirement now using SQS
    Please tell me
    ———————————–
    1. One lambda function will send messages to SQS queue with different group ID's and deduplication ID's
    2 . Now SQS contains all messages
    3. I am not giving any trigger point to this SQS
    4 . Using one SCHEDULED lambda I am receiving messages from QUEUE
    ———————————-
    NOW MY REQUIREMENT IS

    1) I want to receive messages based on group I'd
    Ex: now in SQS 20 messages available
    Group1=10
    Group2 =5
    Group3 = 5
    …..
    Now I want to receive messages from group 3 only

    Is it possible ?

    Please tell me

  2. Dear Friend, Thanks for making simple and amazing tutorial. If you don't mind, can you please share the code

  3. My Freind, very well shown concept, but where is your voice, would like to listen the explanation about the script

Leave a Reply

Your email address will not be published.

Captcha loading...