Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Messenger Amazon SQS Connection::setup() throws exception when needing to create a queue #42208

Closed
@noahduncan

Description

@noahduncan

Amazon SQS Messenger version(s) affected: 5.3

Description
An exception is thrown when trying to setup non-existent queues. The exception is ''The Amazon SQS queue "<queue_name>" does not exists (or you don't have permissions on it), and can't be created when an account is provided.". It is thrown from line 276 of \Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\Connection. Looking at the code in that area, if there is an account set you can't create queues....but the reasoning for this isn't clear.

How to reproduce

Possible Solution
I believe the thrown exception is unnecessary and can be removed.

Note updated
It seems like the error is thrown because of an assumption that if we have an account ID, then we must expect that the queue already exists. However, I don't think that is necessarily true. From what I'm seeing, the queue url is predictable and we can assume it takes the following form: https://sqs.<region>.amazonaws.com/<account>/<queue_name>. From that, I don't think it hurts to ask if the queue exists, and if not, create it. That is basically what the setup function already does. But, perhaps there is a good reason not to trust that scheme?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions