jegesh / python-sqs-listener

A simple wrapper for boto3 for listening, and sending, to an AWS SQS queue
Other
154 stars 72 forks source link

Error queue excluded from list queues prefix in ListQueues check #61

Open andrewatwood opened 1 year ago

andrewatwood commented 1 year ago

Say I have two existing queues: a queue process-queue and an error queue error-queue.

My error queue is never flagged as existing because the ListQueues operation is prefixed to the main queue name:

https://github.com/jegesh/python-sqs-listener/blob/03400ca75f07ae5b98fed199cc65c66967eb4336/sqs_listener/__init__.py#L85-L94

The listener attempts to create the error queue since it wasn't found, and gets a QueueAlreadyExists error immediately.

If I specify the error queue as process-queue-error and it already exists, I don't get any errors, because it comes back in the ListQueues call that uses the prefix.

A couple solutions to this but it's a pretty big issue for anyone using pre-created queues.

jegesh commented 11 months ago

Yeah the code is pretty naive about these things. Feel free to submit a PR with your implementation to solve your issue.