I am trying to use the waiter functionality available for SQS on AWS. However, I have not seen any documentation and python examples of this works
AWS Boto / SQS documentation link referring to Waiter here: http://boto3.readthedocs.io/en/latest/guide/clients.html#waiters, but does not give any detailed examples using SQS
Any guidance appreciated
SQS does not have waiters in boto3.
Note if a client does not have any waiters, it will return an empty list when accessing its waiter_names attribute.
import boto3
sqs = boto3.client('sqs')
sqs.waiter_names
[]
I understand you're looking for a high level way to listen to SQS queues from Python code:
multi_sqs_listener may help you achieve this (disclosure: I'm the author):
from multi_sqs_listener import QueueConfig, EventBus, MultiSQSListener
class MyListener(MultiSQSListener):
def handle_message(self, queue, bus, priority, message):
# This is where your actual event handler code will sit
print(message.body)
my_event_bus = EventBus()
EventBus.register_buses([my_event_bus])
my_queue = QueueConfig('my-queue', my_event_bus)
my_listener = MyListener([my_queue])
my_listener.listen()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With