Enabling long polling in Amazon SQS
import boto3# Create SQS clientsqs = boto3.client('sqs')queue_url = 'SQS_QUEUE_URL'# Long poll for message on provided SQS queueresponse = sqs.receive_message( QueueUrl=queue_url, AttributeNames=[ 'SentTimestamp' ], MaxNumberOfMessages=1, MessageAttributeNames=[ 'All' ], WaitTimeSeconds=20)print(response)