-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Support SQS Transport with QueueUrl as DSN #37305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To expand on this, this is very valuable when creating serverless applications via Here is an example where we can very simply put the queue URL returned by SQS into an environment variable: provider:
...
environment:
APP_ENV: prod
SQS_URL:
Ref: AlertQueue
resources:
Resources:
AlertQueue:
Type: AWS::SQS::Queue Without that feature, we would have to transform the queue URL to match Symfony's prefix ( Solving that issue would allow to merge Bref's Symfony Messenger bridge with the official SQS driver. FYI SQS URLs are distinguishable via a prefix, this is what is done in Bref: public function supports(string $dsn, array $options): bool
{
return preg_match('#^https://sqs\.[\w\-]+\.amazonaws\.com/.+#', $dsn) === 1;
} |
Can I bring another perspective here... If I was allowed to tag a service as a Transport.. Then would I be able to initialize my SqsService with the plain URL? AFAIK I can't tag services as transports and avoid factories.. Allowing the above, I could declare my own Then I could use it into |
awesome thanks @starred-gijs! |
Description
The Amazon SQS Transport now only supports a DSN that starts with
sqs://
,but especially with CloudFormation the QueueUrl could be provided as an environment variable.
See brefphp/symfony-messenger#30 (comment)
Example
The text was updated successfully, but these errors were encountered: