Skip to content

[Messenger] SQS Transport ignores endpoint, queue_name & account from options #37598

@surikman

Description

@surikman

Symfony version(s) affected: 5.1

Description
AmazonSqs Messenger Transport Connection ignores endpoint, queue_name & account from options.
There is only one way to setup:
sqs://vpce-TfLKluIPhZtmo5uJ-zXcBsSWD.sqs.eu-west-1.vpce.amazonaws.com/123456789/my_queue

I would like to use endpoint queue_name and account from Available options as it is described in \Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\Connection but unfortunately this option is not used.

How to reproduce
Configuration:

    transports:
      my_transport:
        dsn: 'sqs://default'
        options:
            endpoint: 'https://vpce-TfLKluIPhZtmo5uJ-zXcBsSWD.sqs.eu-west-1.vpce.amazonaws.com'
            region: 'eu-west-1'
            queue_name: 'my_queue'
            account: '123456789'
            access_key: 'aws-access-key'
            secret_key: 'aws-secret-key'

Initialized Transport will have:
queue_name = ''
account = null

and clientConfiguration will be without custom endpoint

Possible Solution
Use Configuration e.g.:

    transports:
      my_transport:
        dsn: 'sqs://default'  # or maybe e.g.: sqs://custom for this case? (but I think that it is not necessary)
        options:
            endpoint: 'https://vpce-TfLKluIPhZtmo5uJ-zXcBsSWD.sqs.eu-west-1.vpce.amazonaws.com'
            region: 'eu-west-1'
            queue_name: 'my_queue'
            account: '123456789'
            access_key: 'aws-access-key'
            secret_key: 'aws-secret-key'

and in Connection::fromDsn() add something like this to parsing options data

 $configuration['account'] = $options['account'] ?? self::DEFAULT_OPTIONS['account'];
 $configuration['queue_name'] = $options['queue_name'] ?? self::DEFAULT_OPTIONS['queue_name'];
 $clientConfiguration['endpoint'] = $options['endpoint'] ?? self::DEFAULT_OPTIONS['endpoint'];

Additional context

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy